pdev->dev.parent = &parent->dev;
ret = platform_device_add_data(pdev,
- cell, sizeof(struct mfd_cell));
+ cell->platform_data, cell->data_size);
if (ret)
goto fail_device;
tc6393xb_attach_irq(dev);
tc6393xb_cells[TC6393XB_CELL_NAND].driver_data = tcpd->nand_data;
+ tc6393xb_cells[TC6393XB_CELL_NAND].platform_data =
+ &tc6393xb_cells[TC6393XB_CELL_NAND];
+ tc6393xb_cells[TC6393XB_CELL_NAND].data_size =
+ sizeof(tc6393xb_cells[TC6393XB_CELL_NAND]);
retval = mfd_add_devices(dev,
tc6393xb_cells, ARRAY_SIZE(tc6393xb_cells),
int (*suspend)(struct platform_device *dev);
int (*resume)(struct platform_device *dev);
- void *driver_data; /* driver-specific data */
+ /* driver-specific data for MFD-aware "cell" drivers */
+ void *driver_data;
+
+ /* platform_data can be used to either pass data to "generic"
+ driver or as a hook to mfd_cell for the "cell" drivers */
+ void *platform_data;
+ size_t data_size;
/*
* This resources can be specified relatievly to the parent device.
const struct resource *resources;
};
-static inline struct mfd_cell *mfd_get_cell(struct platform_device *pdev)
-{
- return (struct mfd_cell *)pdev->dev.platform_data;
-}
-
extern int mfd_add_devices(struct platform_device *parent,
const struct mfd_cell *cells, int n_devs,
struct resource *mem_base,