Re: [PATCH 16/19] mfd: Use mfd cell platform_data for tps6105x cellsplatform bits

From: Linus Walleij
Date: Wed May 11 2011 - 15:41:37 EST


2011/5/11 Samuel Ortiz <sameo@xxxxxxxxxxxxxxx>:
>> > -       struct tps6105x *tps6105x = mfd_get_data(pdev);
>> > +       struct tps6105x *tps6105x = pdev->dev.platform_data;
>>
>> Can you use platform_get_drvdata(pdev); instead?
>
> I suppose you mean dev_get_platdata() ?

Yes, sorry.

>> >  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...
>
> I agree it's a bug in the current code. But I need to fetch the platform_data
> pointer, so here again I would have to call dev_get_platdata().

Yes again, you're right.

I was mainly after using the pretty accessor functions rather than direct
dereferencing, no big deal.

Thanks,
Linus Walleij
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/