aboutsummaryrefslogtreecommitdiffstats
path: root/p12.patch
diff options
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-05 23:10:14 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-10-05 23:10:14 -0700
commit9e06a307a040bb17573afb2f48b6a7d26920394f (patch)
tree222b8cbd15a432f906f01dcd21de484984a01bc4 /p12.patch
parent439aaed86577bc756086c2193f8fa23ae48d6722 (diff)
downloadpatches-9e06a307a040bb17573afb2f48b6a7d26920394f.tar.gz
new dev_attr bus removal patches added
Diffstat (limited to 'p12.patch')
-rw-r--r--p12.patch52
1 files changed, 52 insertions, 0 deletions
diff --git a/p12.patch b/p12.patch
new file mode 100644
index 00000000000000..0c101b44b21180
--- /dev/null
+++ b/p12.patch
@@ -0,0 +1,52 @@
+---
+ drivers/input/gameport/gameport.c | 17 ++++++++++-------
+ 1 file changed, 10 insertions(+), 7 deletions(-)
+
+--- a/drivers/input/gameport/gameport.c
++++ b/drivers/input/gameport/gameport.c
+@@ -422,14 +422,15 @@ static struct gameport *gameport_get_pen
+ * Gameport port operations
+ */
+
+-static ssize_t gameport_show_description(struct device *dev, struct device_attribute *attr, char *buf)
++static ssize_t gameport_description_show(struct device *dev, struct device_attribute *attr, char *buf)
+ {
+ struct gameport *gameport = to_gameport_port(dev);
+
+ return sprintf(buf, "%s\n", gameport->name);
+ }
++static DEVICE_ATTR(description, S_IRUGO, gameport_description_show, NULL);
+
+-static ssize_t gameport_rebind_driver(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
++static ssize_t drvctl_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count)
+ {
+ struct gameport *gameport = to_gameport_port(dev);
+ struct device_driver *drv;
+@@ -457,12 +458,14 @@ static ssize_t gameport_rebind_driver(st
+
+ return error ? error : count;
+ }
++static DEVICE_ATTR_WO(drvctl);
+
+-static struct device_attribute gameport_device_attrs[] = {
+- __ATTR(description, S_IRUGO, gameport_show_description, NULL),
+- __ATTR(drvctl, S_IWUSR, NULL, gameport_rebind_driver),
+- __ATTR_NULL
++static struct attribute *gameport_device_attrs[] = {
++ &dev_attr_description.attr,
++ &dev_attr_drvctl.attr,
++ NULL,
+ };
++ATTRIBUTE_GROUPS(gameport_device);
+
+ static void gameport_release_port(struct device *dev)
+ {
+@@ -750,7 +753,7 @@ static int gameport_bus_match(struct dev
+
+ static struct bus_type gameport_bus = {
+ .name = "gameport",
+- .dev_attrs = gameport_device_attrs,
++ .dev_groups = gameport_device_groups,
+ .drv_groups = gameport_driver_groups,
+ .match = gameport_bus_match,
+ .probe = gameport_driver_probe,