From: Cornelia Huck <cornelia.huck@de.ibm.com>
To: Akinobu Mita <akinobu.mita@gmail.com>
Cc: linux-kernel@vger.kernel.org, Tejun Heo <htejun@gmail.com>,
Greg Kroah-Hartman <gregkh@suse.de>
Subject: Re: [PATCH] sysdev: remove global sysdev drivers list
Date: Mon, 13 Aug 2007 09:43:31 +0200 [thread overview]
Message-ID: <20070813094331.4bc53e2e@gondolin.boeblingen.de.ibm.com> (raw)
In-Reply-To: <20070812044407.GA4573@APFDCB5C>
On Sun, 12 Aug 2007 13:44:07 +0900,
Akinobu Mita <akinobu.mita@gmail.com> wrote:
> No one uses sysdev_drivers. Because no one calls sysdev_driver_register
> with NULL class.
>
> And it is difficult to imagine that someone want to implement a global
> sysdev driver which is called with all sys_device on any kind of
> sysdev_class.
>
> So this patch removes global sysdev_drivers list.
This makes sense, I guess, especially since it simplyfies the code.
Some minor comments below.
> @@ -182,10 +179,12 @@ int sysdev_driver_register(struct sysdev
> list_for_each_entry(dev, &cls->kset.list, kobj.entry)
> drv->add(dev);
> }
> - } else
> - list_add_tail(&drv->entry, &sysdev_drivers);
> + } else {
> + err = -EINVAL;
> + WARN_ON(1);
Maybe print what went wrong here?
> + }
> mutex_unlock(&sysdev_drivers_lock);
> - return 0;
> + return err;
> }
>
>
> @@ -206,6 +205,8 @@ void sysdev_driver_unregister(struct sys
> drv->remove(dev);
> }
> kset_put(&cls->kset);
> + } else {
> + WARN_ON(1);
This one is redundant, since you already warned on register.
> }
> mutex_unlock(&sysdev_drivers_lock);
> }
> @@ -320,12 +310,6 @@ void sysdev_shutdown(void)
> struct sysdev_driver * drv;
> pr_debug(" %s\n", kobject_name(&sysdev->kobj));
>
> - /* Call global drivers first. */
> - list_for_each_entry(drv, &sysdev_drivers, entry) {
> - if (drv->shutdown)
> - drv->shutdown(sysdev);
> - }
> -
> /* Call auxillary drivers next. */
This comment has become meaningless.
> list_for_each_entry(drv, &cls->drivers, entry) {
> if (drv->shutdown)
> @@ -393,15 +371,6 @@ int sysdev_suspend(pm_message_t state)
> list_for_each_entry(sysdev, &cls->kset.list, kobj.entry) {
> pr_debug(" %s\n", kobject_name(&sysdev->kobj));
>
> - /* Call global drivers first. */
> - list_for_each_entry(drv, &sysdev_drivers, entry) {
> - if (drv->suspend) {
> - ret = drv->suspend(sysdev, state);
> - if (ret)
> - goto gbl_driver;
> - }
> - }
> -
> /* Call auxillary drivers next. */
Dito here.
> list_for_each_entry(drv, &cls->drivers, entry) {
> if (drv->suspend) {
next prev parent reply other threads:[~2007-08-13 12:53 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-12 4:44 Akinobu Mita
2007-08-13 7:43 ` Cornelia Huck [this message]
2007-08-19 7:51 ` Akinobu Mita
2007-08-20 11:21 ` Cornelia Huck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20070813094331.4bc53e2e@gondolin.boeblingen.de.ibm.com \
--to=cornelia.huck@de.ibm.com \
--cc=akinobu.mita@gmail.com \
--cc=gregkh@suse.de \
--cc=htejun@gmail.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®