[svn-commits] tzafrir: linux/trunk r7226 - /linux/trunk/drivers/dahdi/xpp/xbus-sysfs.c
SVN commits to the Digium repositories
svn-commits at lists.digium.com
Mon Sep 28 03:57:12 CDT 2009
Author: tzafrir
Date: Mon Sep 28 03:57:07 2009
New Revision: 7226
URL: http://svnview.digium.com/svn/dahdi?view=rev&rev=7226
Log:
xpp: Use proper get/set for device->driver_data
2.6.32-rc1 broke direct access to the member 'driver_data' of 'struct
device'. However direct access to wasn't proper in the first place.
This commit replaces direct access to dev->driver_data with
dev_get_drvdata() and dev_set_drvdata().
Modified:
linux/trunk/drivers/dahdi/xpp/xbus-sysfs.c
Modified: linux/trunk/drivers/dahdi/xpp/xbus-sysfs.c
URL: http://svnview.digium.com/svn/dahdi/linux/trunk/drivers/dahdi/xpp/xbus-sysfs.c?view=diff&rev=7226&r1=7225&r2=7226
==============================================================================
--- linux/trunk/drivers/dahdi/xpp/xbus-sysfs.c (original)
+++ linux/trunk/drivers/dahdi/xpp/xbus-sysfs.c Mon Sep 28 03:57:07 2009
@@ -707,7 +707,7 @@
dev->parent = &xbus->astribank;
dev_set_name(dev, "%02d:%1x:%1x", xbus->num, xpd->addr.unit,
xpd->addr.subunit);
- dev->driver_data = xpd;
+ dev_set_drvdata(dev, xpd);
dev->release = xpd_release;
ret = device_register(dev);
if(ret) {
@@ -728,11 +728,11 @@
BUG_ON(!xbus);
XPD_DBG(DEVICES, xpd, "SYSFS\n");
dev = &xpd->xpd_dev;
- if(!dev->driver_data)
+ if(!dev_get_drvdata(dev))
return;
- BUG_ON(dev->driver_data != xpd);
+ BUG_ON(dev_get_drvdata(dev) != xpd);
device_unregister(dev);
- dev->driver_data = NULL;
+ dev_set_drvdata(dev, NULL);
}
/*--------- Sysfs Device handling ----*/
@@ -746,9 +746,9 @@
astribank = &xbus->astribank;
BUG_ON(!astribank);
sysfs_remove_link(&astribank->kobj, "transport");
- if(!astribank->driver_data)
+ if(!dev_get_drvdata(astribank))
return;
- BUG_ON(astribank->driver_data != xbus);
+ BUG_ON(dev_get_drvdata(astribank) != xbus);
device_unregister(&xbus->astribank);
}
@@ -764,18 +764,18 @@
astribank->bus = &toplevel_bus_type;
astribank->parent = xbus->transport.transport_device;
dev_set_name(astribank, "xbus-%02d", xbus->num);
- astribank->driver_data = xbus;
+ dev_set_drvdata(astribank, xbus);
astribank->release = astribank_release;
ret = device_register(astribank);
if(ret) {
XBUS_ERR(xbus, "%s: device_register failed: %d\n", __FUNCTION__, ret);
- astribank->driver_data = NULL;
+ dev_set_drvdata(astribank, NULL);
goto out;
}
ret = sysfs_create_link(&astribank->kobj, &astribank->parent->kobj, "transport");
if(ret < 0) {
XBUS_ERR(xbus, "%s: sysfs_create_link failed: %d\n", __FUNCTION__, ret);
- astribank->driver_data = NULL;
+ dev_set_drvdata(astribank, NULL);
goto out;
}
out:
More information about the svn-commits
mailing list