From: Russell King <rmk@arm.linux.org.uk>
To: Patrick Mochel <mochel@osdl.org>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Greg KH <greg@kroah.com>,
linux-kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: PCI PM & compatibility
Date: Thu, 28 Aug 2003 22:45:10 +0100 [thread overview]
Message-ID: <20030828224510.H14031@flint.arm.linux.org.uk> (raw)
In-Reply-To: <Pine.LNX.4.44.0308271523490.4140-100000@cherise>; from mochel@osdl.org on Wed, Aug 27, 2003 at 03:57:14PM -0700
On Wed, Aug 27, 2003 at 03:57:14PM -0700, Patrick Mochel wrote:
> Bah, sorry, I overlooked that. The patch below will add the device before
> calling bus_add_device(). Sorry about the confusion.
For the record, this patch solves the problem, thanks.
> ===== drivers/base/core.c 1.73 vs edited =====
> --- 1.73/drivers/base/core.c Fri Aug 15 10:27:01 2003
> +++ edited/drivers/base/core.c Wed Aug 27 15:49:08 2003
> @@ -225,28 +225,30 @@
> dev->kobj.parent = &parent->kobj;
>
> if ((error = kobject_add(&dev->kobj)))
> - goto register_done;
> -
> - /* now take care of our own registration */
> -
> + goto Error;
> + if ((error = device_pm_add(dev)))
> + goto PMError;
> + if ((error = bus_add_device(dev)))
> + goto BusError;
> down_write(&devices_subsys.rwsem);
> if (parent)
> list_add_tail(&dev->node,&parent->children);
> up_write(&devices_subsys.rwsem);
>
> - bus_add_device(dev);
> -
> - device_pm_add(dev);
> -
> /* notify platform of device entry */
> if (platform_notify)
> platform_notify(dev);
> -
> - register_done:
> - if (error && parent)
> - put_device(parent);
> + Done:
> put_device(dev);
> return error;
> + BusError:
> + device_pm_remove(dev);
> + PMError:
> + kobject_unregister(&dev->kobj);
> + Error:
> + if (parent)
> + put_device(parent);
> + goto Done;
> }
>
>
> @@ -312,8 +314,6 @@
> {
> struct device * parent = dev->parent;
>
> - device_pm_remove(dev);
> -
> down_write(&devices_subsys.rwsem);
> if (parent)
> list_del_init(&dev->node);
> @@ -324,14 +324,11 @@
> */
> if (platform_notify_remove)
> platform_notify_remove(dev);
> -
> bus_remove_device(dev);
> -
> + device_pm_remove(dev);
> kobject_del(&dev->kobj);
> -
> if (parent)
> put_device(parent);
> -
> }
>
> /**
>
--
Russell King (rmk@arm.linux.org.uk) The developer of ARM Linux
http://www.arm.linux.org.uk/personal/aboutme.html
next prev parent reply other threads:[~2003-08-28 21:45 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-08-23 14:39 PCI PM & compatibility Benjamin Herrenschmidt
2003-08-23 17:08 ` Russell King
2003-08-23 17:28 ` Benjamin Herrenschmidt
2003-08-23 17:48 ` Russell King
2003-08-26 15:31 ` Patrick Mochel
2003-08-26 17:51 ` Russell King
2003-08-27 22:57 ` Patrick Mochel
2003-08-28 21:45 ` Russell King [this message]
2003-08-27 12:43 ` Benjamin Herrenschmidt
2003-08-27 23:29 ` Patrick Mochel
2003-08-28 8:39 ` Benjamin Herrenschmidt
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=20030828224510.H14031@flint.arm.linux.org.uk \
--to=rmk@arm.linux.org.uk \
--cc=benh@kernel.crashing.org \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mochel@osdl.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;
as well as URLs for NNTP newsgroup(s).