[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <BANLkTinHyGv11px+cO_ORL0-83T4c-mbsQ@mail.gmail.com>
Date: Mon, 9 May 2011 09:05:19 +0200
From: Linus Walleij <linus.walleij@...aro.org>
To: Samuel Ortiz <sameo@...ux.intel.com>
Cc: linux-kernel <linux-kernel@...r.kernel.org>,
Mark Brown <broonie@...nsource.wolfsonmicro.com>,
Liam Girdwood <lrg@...mlogic.co.uk>
Subject: Re: [PATCH 16/19] mfd: Use mfd cell platform_data for tps6105x cells
platform bits
2011/5/9 Samuel Ortiz <sameo@...ux.intel.com>:
> With the addition of a platform device mfd_cell pointer, MFD drivers
> can go back to passing platform data back to their sub drivers.
> This allows for an mfd_cell->mfd_data removal and thus keep the
> sub drivers MFD agnostic. This is mostly needed for non MFD aware
> sub drivers.
>
> Cc: Mark Brown <broonie@...nsource.wolfsonmicro.com>
> Cc: Liam Girdwood <lrg@...mlogic.co.uk>
> Cc: Linus Walleij <linus.walleij@...aro.org>
> Signed-off-by: Samuel Ortiz <sameo@...ux.intel.com>
I have some question marks on this one...
> --- a/drivers/mfd/tps6105x.c
> +++ b/drivers/mfd/tps6105x.c
> @@ -183,7 +183,8 @@ static int __devinit tps6105x_probe(struct i2c_client *client,
> /* Set up and register the platform devices. */
> for (i = 0; i < ARRAY_SIZE(tps6105x_cells); i++) {
> /* One state holder for all drivers, this is simple */
> - tps6105x_cells[i].mfd_data = tps6105x;
> + tps6105x_cells[i].platform_data = tps6105x;
> + tps6105x_cells[i].pdata_size = sizeof(*tps6105x);
ACK
> --- a/drivers/regulator/tps6105x-regulator.c
> +++ b/drivers/regulator/tps6105x-regulator.c
> @@ -137,7 +137,7 @@ static struct regulator_desc tps6105x_regulator_desc = {
> */
> static int __devinit tps6105x_regulator_probe(struct platform_device *pdev)
> {
> - struct tps6105x *tps6105x = mfd_get_data(pdev);
> + struct tps6105x *tps6105x = pdev->dev.platform_data;
Can you use platform_get_drvdata(pdev); instead?
> struct tps6105x_platform_data *pdata = tps6105x->pdata;
> int ret;
>
> @@ -164,7 +164,7 @@ static int __devinit tps6105x_regulator_probe(struct platform_device *pdev)
>
> static int __devexit tps6105x_regulator_remove(struct platform_device *pdev)
> {
> - struct tps6105x *tps6105x = platform_get_drvdata(pdev);
> + struct tps6105x *tps6105x = pdev->dev.platform_data;
And this is a NO-OP, actually a bug in the present code, just leave it
as it is and the other changes removing the mfd->mfd_data fixes the bug...
Yours,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists