diff options
author | Jingoo Han <jg1.han@samsung.com> | 2013-08-30 01:04:17 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-08-30 17:43:37 -0400 |
commit | df3f1c39406740712f0a2cacb8c3699bf6413ebe (patch) | |
tree | e62fc39b5fd6ffeb76945a853ccb81b858a30cd6 | |
parent | 495c765d7d1ff72b4039bd9a7ba3c627b80ba4d8 (diff) |
net: niu: use dev_get_platdata()
Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly. This is a cosmetic change
to make the code simpler and enhance the readability.
Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/sun/niu.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/net/ethernet/sun/niu.c b/drivers/net/ethernet/sun/niu.c index fa322409bff3..269c08bf399b 100644 --- a/drivers/net/ethernet/sun/niu.c +++ b/drivers/net/ethernet/sun/niu.c | |||
@@ -9360,7 +9360,7 @@ static ssize_t show_port_phy(struct device *dev, | |||
9360 | struct device_attribute *attr, char *buf) | 9360 | struct device_attribute *attr, char *buf) |
9361 | { | 9361 | { |
9362 | struct platform_device *plat_dev = to_platform_device(dev); | 9362 | struct platform_device *plat_dev = to_platform_device(dev); |
9363 | struct niu_parent *p = plat_dev->dev.platform_data; | 9363 | struct niu_parent *p = dev_get_platdata(&plat_dev->dev); |
9364 | u32 port_phy = p->port_phy; | 9364 | u32 port_phy = p->port_phy; |
9365 | char *orig_buf = buf; | 9365 | char *orig_buf = buf; |
9366 | int i; | 9366 | int i; |
@@ -9390,7 +9390,7 @@ static ssize_t show_plat_type(struct device *dev, | |||
9390 | struct device_attribute *attr, char *buf) | 9390 | struct device_attribute *attr, char *buf) |
9391 | { | 9391 | { |
9392 | struct platform_device *plat_dev = to_platform_device(dev); | 9392 | struct platform_device *plat_dev = to_platform_device(dev); |
9393 | struct niu_parent *p = plat_dev->dev.platform_data; | 9393 | struct niu_parent *p = dev_get_platdata(&plat_dev->dev); |
9394 | const char *type_str; | 9394 | const char *type_str; |
9395 | 9395 | ||
9396 | switch (p->plat_type) { | 9396 | switch (p->plat_type) { |
@@ -9419,7 +9419,7 @@ static ssize_t __show_chan_per_port(struct device *dev, | |||
9419 | int rx) | 9419 | int rx) |
9420 | { | 9420 | { |
9421 | struct platform_device *plat_dev = to_platform_device(dev); | 9421 | struct platform_device *plat_dev = to_platform_device(dev); |
9422 | struct niu_parent *p = plat_dev->dev.platform_data; | 9422 | struct niu_parent *p = dev_get_platdata(&plat_dev->dev); |
9423 | char *orig_buf = buf; | 9423 | char *orig_buf = buf; |
9424 | u8 *arr; | 9424 | u8 *arr; |
9425 | int i; | 9425 | int i; |
@@ -9452,7 +9452,7 @@ static ssize_t show_num_ports(struct device *dev, | |||
9452 | struct device_attribute *attr, char *buf) | 9452 | struct device_attribute *attr, char *buf) |
9453 | { | 9453 | { |
9454 | struct platform_device *plat_dev = to_platform_device(dev); | 9454 | struct platform_device *plat_dev = to_platform_device(dev); |
9455 | struct niu_parent *p = plat_dev->dev.platform_data; | 9455 | struct niu_parent *p = dev_get_platdata(&plat_dev->dev); |
9456 | 9456 | ||
9457 | return sprintf(buf, "%d\n", p->num_ports); | 9457 | return sprintf(buf, "%d\n", p->num_ports); |
9458 | } | 9458 | } |