From: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
To: Linux I2C <linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Cc: Kay Sievers <kay.sievers-tD+1rO4QERM@public.gmane.org>
Subject: [PATCH] i2c: Do not give adapters a default parent
Date: Mon, 4 May 2009 12:43:41 +0200 [thread overview]
Message-ID: <20090504124341.42405e79@hyperion.delvare> (raw)
In-Reply-To: <20090426103025.4525edd3-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
We don't need to give adapters a parent if they don't have one. The
driver core will put them in the virtual device directory and all will
be fine.
Signed-off-by: Jean Delvare <khali-PUYAD+kWke1g9hUCZPvPmw@public.gmane.org>
---
Much better than my first attempt. Not sure what will happen if we ever
turn i2c-adapters into bus devices. I see that the driver core puts
class devices without a parent in virtual, but what about _bus_ devices
without a parent? Kay?
drivers/i2c/i2c-core.c | 11 -----------
1 file changed, 11 deletions(-)
--- linux-2.6.30-rc4.orig/drivers/i2c/i2c-core.c 2009-05-03 09:08:51.000000000 +0200
+++ linux-2.6.30-rc4/drivers/i2c/i2c-core.c 2009-05-04 11:19:59.000000000 +0200
@@ -29,7 +29,6 @@
#include <linux/i2c.h>
#include <linux/init.h>
#include <linux/idr.h>
-#include <linux/platform_device.h>
#include <linux/mutex.h>
#include <linux/completion.h>
#include <linux/hardirq.h>
@@ -451,16 +450,6 @@ static int i2c_register_adapter(struct i
mutex_lock(&core_lock);
- /* Add the adapter to the driver core.
- * If the parent pointer is not set up,
- * we add this adapter to the host bus.
- */
- if (adap->dev.parent == NULL) {
- adap->dev.parent = &platform_bus;
- pr_debug("I2C adapter driver [%s] forgot to specify "
- "physical device\n", adap->name);
- }
-
/* Set default timeout to 1 second if not already set */
if (adap->timeout == 0)
adap->timeout = HZ;
--
Jean Delvare
next prev parent reply other threads:[~2009-05-04 10:43 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-26 8:30 [PATCH] i2c: Warn when adapters have no parent Jean Delvare
[not found] ` <20090426103025.4525edd3-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-05-04 10:43 ` Jean Delvare [this message]
[not found] ` <20090504124341.42405e79-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-05-04 12:40 ` [PATCH] i2c: Do not give adapters a default parent Kay Sievers
[not found] ` <ac3eb2510905040540k65afe3f8k7e6c696d11bf7e1d-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-07-04 17:14 ` Jean Delvare
[not found] ` <20090704191431.3d352d0b-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-07-05 20:19 ` Kay Sievers
[not found] ` <ac3eb2510907051319i414a5e78r74d623ebb0508d0-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-07-05 20:56 ` Jean Delvare
[not found] ` <20090705225616.1d4817e7-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-07-05 21:34 ` Kay Sievers
[not found] ` <ac3eb2510907051434i4ee351cbk3db17b50c7e7618b-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-07-22 19:07 ` Jean Delvare
[not found] ` <20090722210753.35802816-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-07-22 21:04 ` Kay Sievers
[not found] ` <1248296688.2065.4.camel-2/CBIq5w30c@public.gmane.org>
2009-07-23 14:02 ` Jean Delvare
[not found] ` <20090723160259.78a10e37-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-07-23 15:19 ` Kay Sievers
[not found] ` <ac3eb2510907230819g1b8edf63g42ffc4c87dbc0cb5-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-07-28 12:47 ` Jean Delvare
[not found] ` <20090728144755.69d328d4-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-07-30 15:12 ` Kay Sievers
[not found] ` <ac3eb2510907300812q2d848108ofe1d25801f7b990f-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2009-08-04 10:55 ` Jean Delvare
[not found] ` <20090804125534.6a555cc2-ig7AzVSIIG7kN2dkZ6Wm7A@public.gmane.org>
2009-08-05 2:20 ` Kay Sievers
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=20090504124341.42405e79@hyperion.delvare \
--to=khali-puyad+kwke1g9huczpvpmw@public.gmane.org \
--cc=kay.sievers-tD+1rO4QERM@public.gmane.org \
--cc=linux-i2c-u79uwXL29TY76Z2rM5mHXA@public.gmane.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).