diff options
author | Ming Lei <tom.leiming@gmail.com> | 2009-03-01 08:10:49 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2009-03-24 19:38:26 -0400 |
commit | f67f129e519fa87f8ebd236b6336fe43f31ee141 (patch) | |
tree | e2832f6d012044f5d05c6130416832235c7d2730 /drivers/s390/cio | |
parent | 4995f8ef9d3aac72745e12419d7fbaa8d01b1d81 (diff) |
Driver core: implement uevent suppress in kobject
This patch implements uevent suppress in kobject and removes it
from struct device, based on the following ideas:
1,Uevent sending should be one attribute of kobject, so suppressing it
in kobject layer is more natural than in device layer. By this way,
we can do it for other objects embedded with kobject.
2,It may save several bytes for each instance of struct device.(On my
omap3(32bit ARM) based box, can save 8bytes per device object)
This patch also introduces dev_set|get_uevent_suppress() helpers to
set and query uevent_suppress attribute in case to help kobject
as private part of struct device in future.
[This version is against the latest driver-core patch set of Greg,please
ignore the last version.]
Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/s390/cio')
-rw-r--r-- | drivers/s390/cio/chsc_sch.c | 4 | ||||
-rw-r--r-- | drivers/s390/cio/css.c | 4 | ||||
-rw-r--r-- | drivers/s390/cio/device.c | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/drivers/s390/cio/chsc_sch.c b/drivers/s390/cio/chsc_sch.c index 0a2f2edafc03..93eca1731b81 100644 --- a/drivers/s390/cio/chsc_sch.c +++ b/drivers/s390/cio/chsc_sch.c | |||
@@ -84,8 +84,8 @@ static int chsc_subchannel_probe(struct subchannel *sch) | |||
84 | kfree(private); | 84 | kfree(private); |
85 | } else { | 85 | } else { |
86 | sch->private = private; | 86 | sch->private = private; |
87 | if (sch->dev.uevent_suppress) { | 87 | if (dev_get_uevent_suppress(&sch->dev)) { |
88 | sch->dev.uevent_suppress = 0; | 88 | dev_set_uevent_suppress(&sch->dev, 0); |
89 | kobject_uevent(&sch->dev.kobj, KOBJ_ADD); | 89 | kobject_uevent(&sch->dev.kobj, KOBJ_ADD); |
90 | } | 90 | } |
91 | } | 91 | } |
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c index 8019288bc6de..427d11d88069 100644 --- a/drivers/s390/cio/css.c +++ b/drivers/s390/cio/css.c | |||
@@ -272,7 +272,7 @@ static int css_register_subchannel(struct subchannel *sch) | |||
272 | * the subchannel driver can decide itself when it wants to inform | 272 | * the subchannel driver can decide itself when it wants to inform |
273 | * userspace of its existence. | 273 | * userspace of its existence. |
274 | */ | 274 | */ |
275 | sch->dev.uevent_suppress = 1; | 275 | dev_set_uevent_suppress(&sch->dev, 1); |
276 | css_update_ssd_info(sch); | 276 | css_update_ssd_info(sch); |
277 | /* make it known to the system */ | 277 | /* make it known to the system */ |
278 | ret = css_sch_device_register(sch); | 278 | ret = css_sch_device_register(sch); |
@@ -287,7 +287,7 @@ static int css_register_subchannel(struct subchannel *sch) | |||
287 | * a fitting driver module may be loaded based on the | 287 | * a fitting driver module may be loaded based on the |
288 | * modalias. | 288 | * modalias. |
289 | */ | 289 | */ |
290 | sch->dev.uevent_suppress = 0; | 290 | dev_set_uevent_suppress(&sch->dev, 0); |
291 | kobject_uevent(&sch->dev.kobj, KOBJ_ADD); | 291 | kobject_uevent(&sch->dev.kobj, KOBJ_ADD); |
292 | } | 292 | } |
293 | return ret; | 293 | return ret; |
diff --git a/drivers/s390/cio/device.c b/drivers/s390/cio/device.c index 23d5752349b5..611d2e001dd5 100644 --- a/drivers/s390/cio/device.c +++ b/drivers/s390/cio/device.c | |||
@@ -981,7 +981,7 @@ io_subchannel_register(struct work_struct *work) | |||
981 | * Now we know this subchannel will stay, we can throw | 981 | * Now we know this subchannel will stay, we can throw |
982 | * our delayed uevent. | 982 | * our delayed uevent. |
983 | */ | 983 | */ |
984 | sch->dev.uevent_suppress = 0; | 984 | dev_set_uevent_suppress(&sch->dev, 0); |
985 | kobject_uevent(&sch->dev.kobj, KOBJ_ADD); | 985 | kobject_uevent(&sch->dev.kobj, KOBJ_ADD); |
986 | /* make it known to the system */ | 986 | /* make it known to the system */ |
987 | ret = ccw_device_register(cdev); | 987 | ret = ccw_device_register(cdev); |
@@ -1243,7 +1243,7 @@ static int io_subchannel_probe(struct subchannel *sch) | |||
1243 | * the ccw_device and exit. This happens for all early | 1243 | * the ccw_device and exit. This happens for all early |
1244 | * devices, e.g. the console. | 1244 | * devices, e.g. the console. |
1245 | */ | 1245 | */ |
1246 | sch->dev.uevent_suppress = 0; | 1246 | dev_set_uevent_suppress(&sch->dev, 0); |
1247 | kobject_uevent(&sch->dev.kobj, KOBJ_ADD); | 1247 | kobject_uevent(&sch->dev.kobj, KOBJ_ADD); |
1248 | cdev->dev.groups = ccwdev_attr_groups; | 1248 | cdev->dev.groups = ccwdev_attr_groups; |
1249 | device_initialize(&cdev->dev); | 1249 | device_initialize(&cdev->dev); |