Skip to content

Commit

Permalink
net: niu: use dev_get_platdata()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jingoo Han authored and David S. Miller committed Aug 30, 2013
1 parent 495c765 commit df3f1c3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/net/ethernet/sun/niu.c
Original file line number Diff line number Diff line change
Expand Up @@ -9360,7 +9360,7 @@ static ssize_t show_port_phy(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct platform_device *plat_dev = to_platform_device(dev);
struct niu_parent *p = plat_dev->dev.platform_data;
struct niu_parent *p = dev_get_platdata(&plat_dev->dev);
u32 port_phy = p->port_phy;
char *orig_buf = buf;
int i;
Expand Down Expand Up @@ -9390,7 +9390,7 @@ static ssize_t show_plat_type(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct platform_device *plat_dev = to_platform_device(dev);
struct niu_parent *p = plat_dev->dev.platform_data;
struct niu_parent *p = dev_get_platdata(&plat_dev->dev);
const char *type_str;

switch (p->plat_type) {
Expand Down Expand Up @@ -9419,7 +9419,7 @@ static ssize_t __show_chan_per_port(struct device *dev,
int rx)
{
struct platform_device *plat_dev = to_platform_device(dev);
struct niu_parent *p = plat_dev->dev.platform_data;
struct niu_parent *p = dev_get_platdata(&plat_dev->dev);
char *orig_buf = buf;
u8 *arr;
int i;
Expand Down Expand Up @@ -9452,7 +9452,7 @@ static ssize_t show_num_ports(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct platform_device *plat_dev = to_platform_device(dev);
struct niu_parent *p = plat_dev->dev.platform_data;
struct niu_parent *p = dev_get_platdata(&plat_dev->dev);

return sprintf(buf, "%d\n", p->num_ports);
}
Expand Down

0 comments on commit df3f1c3

Please sign in to comment.