Re: [PATCH v3 1/7] mfd: add pruss mfd driver.

From: Subhasish Ghosh
Date: Wed Mar 30 2011 - 05:12:54 EST


Hi Arnd,

I am using a .setup to initialize pin mux etc. To use the mfd_cells directly should I
use .enable and .disable of the mfd_cells instead of the .setup.

+static int pruss_mfd_add_devices(struct platform_device *pdev)
+{
+ struct da8xx_pruss_devices *dev_data = pdev->dev.platform_data;
+ struct device *dev = &pdev->dev;
+ struct mfd_cell cell;
+ u32 err, count;
+
+ for (count = 0; dev_data[count].dev_name != NULL; count++) {
+ memset(&cell, 0, sizeof(struct mfd_cell));
+ cell.id = count;
+ cell.name = dev_data[count].dev_name;
+ cell.platform_data = dev_data[count].pdata;
+ cell.data_size = dev_data[count].pdata_size;
+ cell.resources = dev_data[count].resources;
+ cell.num_resources = dev_data[count].num_resources;
+
+ err = mfd_add_devices(dev, 0, &cell, 1, NULL, 0);
+ if (err) {
+ dev_err(dev, "cannot add mfd cells\n");
+ return err;
+ }
+ dev_info(dev, "mfd: added %s device\n",
+ dev_data[count].dev_name);
+ }
+
+ return err;
+}

This would get much simpler if you just replaced the da8xx_pruss_devices
array with an mfd_cell array.

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