net: remove driver_data direct access of struct device
In the near future, the driver core is going to not allow direct access to the driver_data pointer in struct device. Instead, the functions dev_get_drvdata() and dev_set_drvdata() should be used. These functions have been around since the beginning, so are backwards compatible with all older kernel versions. Cc: netdev@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
aba7453037
commit
1aec5bdfed
@@ -482,7 +482,7 @@ static ssize_t hso_sysfs_show_porttype(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
char *buf)
|
||||
{
|
||||
struct hso_device *hso_dev = dev->driver_data;
|
||||
struct hso_device *hso_dev = dev_get_drvdata(dev);
|
||||
char *port_name;
|
||||
|
||||
if (!hso_dev)
|
||||
@@ -2313,7 +2313,7 @@ static int hso_serial_common_create(struct hso_serial *serial, int num_urbs,
|
||||
serial->parent->dev = tty_register_device(tty_drv, minor,
|
||||
&serial->parent->interface->dev);
|
||||
dev = serial->parent->dev;
|
||||
dev->driver_data = serial->parent;
|
||||
dev_set_drvdata(dev, serial->parent);
|
||||
i = device_create_file(dev, &dev_attr_hsotype);
|
||||
|
||||
/* fill in specific data for later use */
|
||||
|
Reference in New Issue
Block a user