Thread (24 messages) 24 messages, 6 authors, 2016-08-04

Re: [PATCH v3 1/4] mfd: mxs-lradc: Add support for mxs-lradc MFD

flat view

From: Harald Geyer <hidden>
Date: 2016-07-01 13:19:46
Also in: linux-iio, lkml

Hi Ksenija!

Ksenija Stanojević writes:
On Tue, Jun 28, 2016 at 6:28 PM, Lee Jones [off-list ref] wrote:
quoted
quoted
+static int mxs_lradc_add_device(struct platform_device *pdev,
+                             struct mxs_lradc *lradc, char *name, int i)
+{
+     struct mfd_cell *cell;
+
+     cell = &lradc->cells[i];
+     cell->name = name;
+     cell->platform_data = lradc;
+     cell->pdata_size = sizeof(*lradc);
+
+     return devm_mfd_add_devices(&pdev->dev, -1, cell, 1, NULL, 0, NULL);
+}
Please don't roll your own API.

Use 'struct mfd_cell' like everyone else does.
It has been suggested in previous reviews to use separate function to
register mfd device, and to make mfd_cell allocate dynamically because
struc mxs-lradc is allocated dynamically.
But I can revrse changes and make mfd_cells allocate staticaly
wthout separate function.
I think making mfd_cells members of struct mxs-lradc will address all
review comments.

HTH,
Harald
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help