* [RFC internal PATCH] mfd/mc13xxx: drop modifying driver's id_table in probe
@ 2012-07-11 11:36 Uwe Kleine-König
2012-07-12 1:10 ` Shawn Guo
2012-07-16 13:41 ` Samuel Ortiz
0 siblings, 2 replies; 3+ messages in thread
From: Uwe Kleine-König @ 2012-07-11 11:36 UTC (permalink / raw)
To: linux-arm-kernel
This was introduced in commit
876989d (mfd: Add device tree probe support for mc13xxx)
for spi and later while introducing support for i2c copied to the i2c
driver.
Modifying driver details is very strange, for example probing an
mc13892 device (instantiated via dt) removes the driver's ability to
handle (traditionally probed) mc13783 devices in this case.
I'm not aware of any problems that make this hack necessary and if
there were some, they'd have to be fixed in the spi/i2c core, not in
a driver.
Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
Hello Samuel,
even though this qualifies as fix, I don't think it's necessary to annoy
Linus with it for 3.5. Usually there is only one pmic on each machine so
it's not grave when probing one device disables support for another.
Best regards
Uwe
drivers/mfd/mc13xxx-i2c.c | 6 ------
drivers/mfd/mc13xxx-spi.c | 6 ------
2 files changed, 12 deletions(-)
diff --git a/drivers/mfd/mc13xxx-i2c.c b/drivers/mfd/mc13xxx-i2c.c
index d22501d..e00e885 100644
--- a/drivers/mfd/mc13xxx-i2c.c
+++ b/drivers/mfd/mc13xxx-i2c.c
@@ -53,16 +53,10 @@ static struct regmap_config mc13xxx_regmap_i2c_config = {
static int mc13xxx_i2c_probe(struct i2c_client *client,
const struct i2c_device_id *id)
{
- const struct of_device_id *of_id;
- struct i2c_driver *idrv = to_i2c_driver(client->dev.driver);
struct mc13xxx *mc13xxx;
struct mc13xxx_platform_data *pdata = dev_get_platdata(&client->dev);
int ret;
- of_id = of_match_device(mc13xxx_dt_ids, &client->dev);
- if (of_id)
- idrv->id_table = (const struct i2c_device_id*) of_id->data;
-
mc13xxx = kzalloc(sizeof(*mc13xxx), GFP_KERNEL);
if (!mc13xxx)
return -ENOMEM;
diff --git a/drivers/mfd/mc13xxx-spi.c b/drivers/mfd/mc13xxx-spi.c
index 03df422..b99e728 100644
--- a/drivers/mfd/mc13xxx-spi.c
+++ b/drivers/mfd/mc13xxx-spi.c
@@ -119,16 +119,10 @@ static struct regmap_bus regmap_mc13xxx_bus = {
static int mc13xxx_spi_probe(struct spi_device *spi)
{
- const struct of_device_id *of_id;
- struct spi_driver *sdrv = to_spi_driver(spi->dev.driver);
struct mc13xxx *mc13xxx;
struct mc13xxx_platform_data *pdata = dev_get_platdata(&spi->dev);
int ret;
- of_id = of_match_device(mc13xxx_dt_ids, &spi->dev);
- if (of_id)
- sdrv->id_table = &mc13xxx_device_id[(enum mc13xxx_id) of_id->data];
-
mc13xxx = kzalloc(sizeof(*mc13xxx), GFP_KERNEL);
if (!mc13xxx)
return -ENOMEM;
--
1.7.10.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [RFC internal PATCH] mfd/mc13xxx: drop modifying driver's id_table in probe
2012-07-11 11:36 [RFC internal PATCH] mfd/mc13xxx: drop modifying driver's id_table in probe Uwe Kleine-König
@ 2012-07-12 1:10 ` Shawn Guo
2012-07-16 13:41 ` Samuel Ortiz
1 sibling, 0 replies; 3+ messages in thread
From: Shawn Guo @ 2012-07-12 1:10 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Jul 11, 2012 at 01:36:48PM +0200, Uwe Kleine-K?nig wrote:
> This was introduced in commit
>
> 876989d (mfd: Add device tree probe support for mc13xxx)
>
> for spi and later while introducing support for i2c copied to the i2c
> driver.
>
> Modifying driver details is very strange, for example probing an
> mc13892 device (instantiated via dt) removes the driver's ability to
> handle (traditionally probed) mc13783 devices in this case.
> I'm not aware of any problems that make this hack necessary and if
> there were some, they'd have to be fixed in the spi/i2c core, not in
> a driver.
>
> Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
The code was added by me, and it turns out the change is completely
unnecessary. So,
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Regards,
Shawn
^ permalink raw reply [flat|nested] 3+ messages in thread
* [RFC internal PATCH] mfd/mc13xxx: drop modifying driver's id_table in probe
2012-07-11 11:36 [RFC internal PATCH] mfd/mc13xxx: drop modifying driver's id_table in probe Uwe Kleine-König
2012-07-12 1:10 ` Shawn Guo
@ 2012-07-16 13:41 ` Samuel Ortiz
1 sibling, 0 replies; 3+ messages in thread
From: Samuel Ortiz @ 2012-07-16 13:41 UTC (permalink / raw)
To: linux-arm-kernel
Hi Uwe,
On Wed, Jul 11, 2012 at 01:36:48PM +0200, Uwe Kleine-K?nig wrote:
> This was introduced in commit
>
> 876989d (mfd: Add device tree probe support for mc13xxx)
>
> for spi and later while introducing support for i2c copied to the i2c
> driver.
>
> Modifying driver details is very strange, for example probing an
> mc13892 device (instantiated via dt) removes the driver's ability to
> handle (traditionally probed) mc13783 devices in this case.
> I'm not aware of any problems that make this hack necessary and if
> there were some, they'd have to be fixed in the spi/i2c core, not in
> a driver.
>
> Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
> ---
> Hello Samuel,
>
> even though this qualifies as fix, I don't think it's necessary to annoy
> Linus with it for 3.5. Usually there is only one pmic on each machine so
> it's not grave when probing one device disables support for another.
I agree, and I'm pushing this one for the next merge window.
Cheers,
Samuel.
--
Intel Open Source Technology Centre
http://oss.intel.com/
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-07-16 13:41 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-11 11:36 [RFC internal PATCH] mfd/mc13xxx: drop modifying driver's id_table in probe Uwe Kleine-König
2012-07-12 1:10 ` Shawn Guo
2012-07-16 13:41 ` Samuel Ortiz
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).