[zaptel-commits] sruffell: branch 1.4 r4687 - /branches/1.4/kernel/xpp/xbus-sysfs.c
SVN commits to the Zaptel project
zaptel-commits at lists.digium.com
Sun Oct 4 14:31:50 CDT 2009
Author: sruffell
Date: Sun Oct 4 14:31:49 2009
New Revision: 4687
URL: http://svnview.digium.com/svn/zaptel?view=rev&rev=4687
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().
This is a backport from https://origsvn.digium.com/svn/dahdi/linux/trunk@7226.
From: tzafrir <tzafrir at 22b186d9-ae4d-0410-a2cf-b1b22c4d6fbd>
Modified:
branches/1.4/kernel/xpp/xbus-sysfs.c
Modified: branches/1.4/kernel/xpp/xbus-sysfs.c
URL: http://svnview.digium.com/svn/zaptel/branches/1.4/kernel/xpp/xbus-sysfs.c?view=diff&rev=4687&r1=4686&r2=4687
==============================================================================
--- branches/1.4/kernel/xpp/xbus-sysfs.c (original)
+++ branches/1.4/kernel/xpp/xbus-sysfs.c Sun Oct 4 14:31:49 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 zaptel-commits
mailing list