Re: [PATCHv2 2/4] cpufreq: cpufreq-dt: extend with platform_data

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Dear Viresh Kumar,

On Wed, 10 Sep 2014 17:52:59 +0530, Viresh Kumar wrote:
> On 10 September 2014 17:38, Thomas Petazzoni
> <thomas.petazzoni@xxxxxxxxxxxxxxxxxx> wrote:
> > +       dt_cpufreq_driver.driver_data = dev_get_platdata(&pdev->dev);
> 
> I don't think this is right. What if platform device's platform data
> is freed later?
> That's why its always better to duplicate that structure instead of playing with
> pointers.

Isn't the piece of code registering the platform_device supposed to
make sure that platform_data doesn't disappear? At least, in PATCH 3/4,
I'm using platform_device_register_data(), which does a kmemdup() of
the custom data being passed before assigning the struct
device->platform_data field.

But if you like, I can add one more memory copy :)

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com
--
To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [Linux for Sparc]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux