All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
To: Samuel Ortiz <samuel.ortiz@intel.com>
Cc: kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org,
	linux-kernel@vger.kernel.org,
	"Ying-Chun Liu (PaulLiu)" <paulliu@debian.org>,
	"Philippe Rétornaz" <philippe.retornaz@epfl.ch>,
	"Marc Reilly" <marc@cpdesign.com.au>,
	"Mark Brown" <broonie@opensource.wolfsonmicro.com>
Subject: [PATCH 5/7] mfd/mc13xxx: drop modifying driver's id_table in probe
Date: Thu, 12 Jul 2012 11:57:51 +0200	[thread overview]
Message-ID: <1342087073-3892-6-git-send-email-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <1342087073-3892-1-git-send-email-u.kleine-koenig@pengutronix.de>

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 have to be fixed in the spi/i2c core, not in
a driver.

Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 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


WARNING: multiple messages have this Message-ID (diff)
From: u.kleine-koenig@pengutronix.de (Uwe Kleine-König)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/7] mfd/mc13xxx: drop modifying driver's id_table in probe
Date: Thu, 12 Jul 2012 11:57:51 +0200	[thread overview]
Message-ID: <1342087073-3892-6-git-send-email-u.kleine-koenig@pengutronix.de> (raw)
In-Reply-To: <1342087073-3892-1-git-send-email-u.kleine-koenig@pengutronix.de>

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 have to be fixed in the spi/i2c core, not in
a driver.

Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Uwe Kleine-K?nig <u.kleine-koenig@pengutronix.de>
---
 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

  parent reply	other threads:[~2012-07-12 10:11 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-07-12  9:57 [PATCH 0/7] Add support for Freescale's mc34708 to mc13xxx driver Uwe Kleine-König
2012-07-12  9:57 ` Uwe Kleine-König
2012-07-12  9:57 ` [PATCH 1/7] MFD: Fix mc13xxx SPI regmap Uwe Kleine-König
2012-07-12  9:57   ` Uwe Kleine-König
2012-07-12  9:57 ` [PATCH 2/7] MFD: mc13xxx workaround SPI hardware bug on i.Mx Uwe Kleine-König
2012-07-12  9:57   ` Uwe Kleine-König
2012-07-12  9:57 ` [PATCH 3/7] rtc/mc13xxx: use MODULE_DEVICE_TABLE instead of MODULE_ALIAS Uwe Kleine-König
2012-07-12  9:57   ` Uwe Kleine-König
2012-07-12  9:57 ` [PATCH 4/7] rtc/mc13xxx: add support for the rtc in the mc34708 pmic Uwe Kleine-König
2012-07-12  9:57   ` Uwe Kleine-König
2012-07-12  9:57 ` Uwe Kleine-König [this message]
2012-07-12  9:57   ` [PATCH 5/7] mfd/mc13xxx: drop modifying driver's id_table in probe Uwe Kleine-König
2012-07-12  9:57 ` [PATCH 6/7] mfd/mc13xxx: change probing details for mc13xxx devices Uwe Kleine-König
2012-07-12  9:57   ` Uwe Kleine-König
2012-07-13 15:22   ` Uwe Kleine-König
2012-07-13 15:22     ` Uwe Kleine-König
2012-07-12  9:57 ` [PATCH 7/7] mfd/mc13xxx: add support for mc34708 Uwe Kleine-König
2012-07-12  9:57   ` Uwe Kleine-König
2012-07-12 23:02 ` [PATCH 0/7] Add support for Freescale's mc34708 to mc13xxx driver Marc Reilly
2012-07-12 23:02   ` Marc Reilly
2012-07-13  8:48   ` Uwe Kleine-König
2012-07-13  8:48     ` Uwe Kleine-König
2012-07-13 19:39     ` Junio C Hamano
2012-09-05 14:22   ` Fabio Estevam
2012-09-05 14:22     ` Fabio Estevam
2012-10-04 13:01     ` Fabio Estevam
2012-10-04 13:01       ` Fabio Estevam
2012-10-04 13:51       ` Samuel Ortiz
2012-10-04 13:51         ` Samuel Ortiz
2012-10-04 14:11         ` Uwe Kleine-König
2012-10-04 14:11           ` Uwe Kleine-König
2012-10-27 19:19         ` Fabio Estevam
2012-10-27 19:19           ` Fabio Estevam
2012-11-06 22:24           ` Samuel Ortiz
2012-11-06 22:24             ` Samuel Ortiz
2012-08-02 15:52 ` Fabio Estevam
2012-08-02 15:52   ` Fabio Estevam

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=1342087073-3892-6-git-send-email-u.kleine-koenig@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=marc@cpdesign.com.au \
    --cc=paulliu@debian.org \
    --cc=philippe.retornaz@epfl.ch \
    --cc=samuel.ortiz@intel.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.