Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 135618
b: refs/heads/master
c: e909074
h: refs/heads/master
v: v3
  • Loading branch information
Sebastian Ott authored and Martin Schwidefsky committed Mar 26, 2009
1 parent 4cd1ee3 commit 53a7f17
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 7 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 50f1548399b7bd00ceb38c84a84463a89c82afe8
refs/heads/master: e909074bb91773680c0b2e49ea8af9f85c6f59bd
42 changes: 36 additions & 6 deletions trunk/drivers/s390/cio/ccwgroup.c
Original file line number Diff line number Diff line change
Expand Up @@ -314,16 +314,32 @@ int ccwgroup_create_from_string(struct device *root, unsigned int creator_id,
}
EXPORT_SYMBOL(ccwgroup_create_from_string);

static int __init
init_ccwgroup (void)
static int ccwgroup_notifier(struct notifier_block *nb, unsigned long action,
void *data);

static struct notifier_block ccwgroup_nb = {
.notifier_call = ccwgroup_notifier
};

static int __init init_ccwgroup(void)
{
return bus_register (&ccwgroup_bus_type);
int ret;

ret = bus_register(&ccwgroup_bus_type);
if (ret)
return ret;

ret = bus_register_notifier(&ccwgroup_bus_type, &ccwgroup_nb);
if (ret)
bus_unregister(&ccwgroup_bus_type);

return ret;
}

static void __exit
cleanup_ccwgroup (void)
static void __exit cleanup_ccwgroup(void)
{
bus_unregister (&ccwgroup_bus_type);
bus_unregister_notifier(&ccwgroup_bus_type, &ccwgroup_nb);
bus_unregister(&ccwgroup_bus_type);
}

module_init(init_ccwgroup);
Expand Down Expand Up @@ -455,6 +471,7 @@ ccwgroup_remove (struct device *dev)
struct ccwgroup_driver *gdrv;

device_remove_file(dev, &dev_attr_online);
device_remove_file(dev, &dev_attr_ungroup);

if (!dev->driver)
return 0;
Expand Down Expand Up @@ -492,6 +509,19 @@ static struct bus_type ccwgroup_bus_type = {
.shutdown = ccwgroup_shutdown,
};


static int ccwgroup_notifier(struct notifier_block *nb, unsigned long action,
void *data)
{
struct device *dev = data;

if (action == BUS_NOTIFY_UNBIND_DRIVER)
device_schedule_callback(dev, ccwgroup_ungroup_callback);

return NOTIFY_OK;
}


/**
* ccwgroup_driver_register() - register a ccw group driver
* @cdriver: driver to be registered
Expand Down

0 comments on commit 53a7f17

Please sign in to comment.