Re: [PATCH 2/3] misc: bmp085: Add DT bindings for EOC gpio line and direct irq.

From: Arnd Bergmann
Date: Fri Nov 15 2013 - 08:56:41 EST


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
--
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/