summaryrefslogtreecommitdiff
path: root/drivers/tty/nozomi.c
diff options
context:
space:
mode:
authorChuhong Yuan <hslester96@gmail.com>2019-07-24 21:18:25 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-09-04 12:43:44 +0200
commit18b1345e60ae8887d914e83f535962cd3bb1c1be (patch)
treee9438ccde6e6f1b7ac009d9f885dde5e1dfba9bb /drivers/tty/nozomi.c
parent76b4106c4b4843d4815c5d0bd3352f662ae586d8 (diff)
tty: nozomi: Use dev_get_drvdata
Instead of using to_pci_dev + pci_get_drvdata, use dev_get_drvdata to make code simpler. Signed-off-by: Chuhong Yuan <hslester96@gmail.com> Link: https://lore.kernel.org/r/20190724131825.1875-1-hslester96@gmail.com Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty/nozomi.c')
-rw-r--r--drivers/tty/nozomi.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/tty/nozomi.c b/drivers/tty/nozomi.c
index 3214e22e79f3..ed99948f3b7f 100644
--- a/drivers/tty/nozomi.c
+++ b/drivers/tty/nozomi.c
@@ -1282,7 +1282,7 @@ static void nozomi_setup_private_data(struct nozomi *dc)
static ssize_t card_type_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
- const struct nozomi *dc = pci_get_drvdata(to_pci_dev(dev));
+ const struct nozomi *dc = dev_get_drvdata(dev);
return sprintf(buf, "%d\n", dc->card_type);
}
@@ -1291,7 +1291,7 @@ static DEVICE_ATTR_RO(card_type);
static ssize_t open_ttys_show(struct device *dev, struct device_attribute *attr,
char *buf)
{
- const struct nozomi *dc = pci_get_drvdata(to_pci_dev(dev));
+ const struct nozomi *dc = dev_get_drvdata(dev);
return sprintf(buf, "%u\n", dc->open_ttys);
}