diff options
author | Fuqian Huang <huangfq.daxian@gmail.com> | 2019-07-04 10:36:33 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-07-05 15:24:41 -0700 |
commit | 233cc605a2ef2ec051086b360e0e47c54bba7c32 (patch) | |
tree | ca0acb6647d350b21bd6f7293be0fbc2fdb77872 /drivers/net/can | |
parent | e3b60ffbc16feeb007d07b2b7d1da4304e98c1a3 (diff) | |
download | linux-233cc605a2ef2ec051086b360e0e47c54bba7c32.tar.gz linux-233cc605a2ef2ec051086b360e0e47c54bba7c32.tar.bz2 linux-233cc605a2ef2ec051086b360e0e47c54bba7c32.zip |
net/can: using dev_get_drvdata directly
Several drivers cast a struct device pointer to a struct
platform_device pointer only to then call platform_get_drvdata().
To improve readability, these constructs can be simplified
by using dev_get_drvdata() directly.
Signed-off-by: Fuqian Huang <huangfq.daxian@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/can')
-rw-r--r-- | drivers/net/can/softing/softing_main.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/can/softing/softing_main.c b/drivers/net/can/softing/softing_main.c index 68bb58a57f3b..8242fb287cbb 100644 --- a/drivers/net/can/softing/softing_main.c +++ b/drivers/net/can/softing/softing_main.c @@ -683,7 +683,7 @@ static void softing_netdev_cleanup(struct net_device *netdev) static ssize_t show_##name(struct device *dev, \ struct device_attribute *attr, char *buf) \ { \ - struct softing *card = platform_get_drvdata(to_platform_device(dev)); \ + struct softing *card = dev_get_drvdata(dev); \ return sprintf(buf, "%u\n", card->member); \ } \ static DEVICE_ATTR(name, 0444, show_##name, NULL) @@ -692,7 +692,7 @@ static DEVICE_ATTR(name, 0444, show_##name, NULL) static ssize_t show_##name(struct device *dev, \ struct device_attribute *attr, char *buf) \ { \ - struct softing *card = platform_get_drvdata(to_platform_device(dev)); \ + struct softing *card = dev_get_drvdata(dev); \ return sprintf(buf, "%s\n", card->member); \ } \ static DEVICE_ATTR(name, 0444, show_##name, NULL) |