net: remove driver_data direct access of struct device from more drivers
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. 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
088eb2d905
commit
c7ae011dc8
@@ -3256,7 +3256,7 @@ static ssize_t ehea_probe_port(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
struct ehea_adapter *adapter = dev->driver_data;
|
||||
struct ehea_adapter *adapter = dev_get_drvdata(dev);
|
||||
struct ehea_port *port;
|
||||
struct device_node *eth_dn = NULL;
|
||||
int i;
|
||||
@@ -3311,7 +3311,7 @@ static ssize_t ehea_remove_port(struct device *dev,
|
||||
struct device_attribute *attr,
|
||||
const char *buf, size_t count)
|
||||
{
|
||||
struct ehea_adapter *adapter = dev->driver_data;
|
||||
struct ehea_adapter *adapter = dev_get_drvdata(dev);
|
||||
struct ehea_port *port;
|
||||
int i;
|
||||
u32 logical_port_id;
|
||||
@@ -3399,7 +3399,7 @@ static int __devinit ehea_probe_adapter(struct of_device *dev,
|
||||
|
||||
adapter->pd = EHEA_PD_ID;
|
||||
|
||||
dev->dev.driver_data = adapter;
|
||||
dev_set_drvdata(&dev->dev, adapter);
|
||||
|
||||
|
||||
/* initialize adapter and ports */
|
||||
@@ -3463,7 +3463,7 @@ out:
|
||||
|
||||
static int __devexit ehea_remove(struct of_device *dev)
|
||||
{
|
||||
struct ehea_adapter *adapter = dev->dev.driver_data;
|
||||
struct ehea_adapter *adapter = dev_get_drvdata(&dev->dev);
|
||||
int i;
|
||||
|
||||
for (i = 0; i < EHEA_MAX_PORTS; i++)
|
||||
|
Reference in New Issue
Block a user