Messages in this thread | | | From | Arnd Bergmann <> | Subject | Re: [PATCH 2/3] misc: bmp085: Add DT bindings for EOC gpio line and direct irq. | Date | Fri, 15 Nov 2013 14:56:19 +0100 |
| |
On Thursday 14 November 2013, Marek Belisko wrote: > + if (node && !pdata) { > + pdata = devm_kzalloc(dev, sizeof(struct bmp085_platform_data), > + GFP_KERNEL); > + if (!pdata) > + return -ENOMEM; > + } > +
I generally recommend against allocating platform data from inside the driver, as this requires more code and more memory than just adding fields to the driver-specific data structure and copying over the fields from either DT or the supplied platform data, depending on which one is used.
Arnd
| |