9
0
Fork 0

of: use 'const void *' for struct of_device_id.data

Since 2011 barebox' of_device_id struct uses unsigned long type for data field:

    struct of_device_id {
            char *compatible;
            unsigned long data;
    };

Almost always struct of_device_id.data field are used as pointer
and need 'unsigned long' casting.

E.g. see 'git grep -A 4 of_device_id drivers/' output:

    drivers/ata/sata-imx.c:static __maybe_unused struct of_device_id imx_sata_dt_ids[] = {
    drivers/ata/sata-imx.c- {
    drivers/ata/sata-imx.c-         .compatible = "fsl,imx6q-ahci",
    drivers/ata/sata-imx.c-         .data = (unsigned long)&data_imx6,
    drivers/ata/sata-imx.c- }, {

Here is of_device_id struct in linux kernel v4.0:

    struct of_device_id {
            char name[32];
            char type[32];
            char compatible[128];
            const void *data;
    };

Changing of_device_id.data type to 'const void *data' will increase
barebox' linux kernel compatibility and decrease number of 'unsigned
long' casts.

Part of the patch was done using the 'coccinelle' tool with the
following semantic patch:

    @rule1@
    identifier dev;
    identifier type;
    identifier func;
    @@
    func(...) {
    <...
    - dev_get_drvdata(dev, (unsigned long *)&type)
    + dev_get_drvdata(dev, (const void **)&type)
    ...>
    }
    @rule2@
    identifier dev;
    identifier type;
    identifier func;
    identifier data;
    @@
    func(...) {
    <...
    - dev_get_drvdata(dev, (unsigned long *)&type->data)
    + dev_get_drvdata(dev, (const void **)&type->data)
    ...>
    }

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This commit is contained in:
Antony Pavlov 2015-04-29 11:56:58 +03:00 committed by Sascha Hauer
parent 92207cde49
commit 377d261708
53 changed files with 188 additions and 188 deletions

View File

@ -99,7 +99,7 @@ static int imx_gpt_probe(struct device_d *dev)
if (timer_base) if (timer_base)
return 0; return 0;
ret = dev_get_drvdata(dev, (unsigned long *)&regs); ret = dev_get_drvdata(dev, (const void **)&regs);
if (ret) if (ret)
return ret; return ret;
@ -136,10 +136,10 @@ static int imx_gpt_probe(struct device_d *dev)
static __maybe_unused struct of_device_id imx_gpt_dt_ids[] = { static __maybe_unused struct of_device_id imx_gpt_dt_ids[] = {
{ {
.compatible = "fsl,imx1-gpt", .compatible = "fsl,imx1-gpt",
.data = (unsigned long)&regs_imx1, .data = &regs_imx1,
}, { }, {
.compatible = "fsl,imx31-gpt", .compatible = "fsl,imx31-gpt",
.data = (unsigned long)&regs_imx31, .data = &regs_imx31,
}, { }, {
/* sentinel */ /* sentinel */
} }

View File

@ -312,7 +312,7 @@ static int imx_esdctl_probe(struct device_d *dev)
int ret; int ret;
void *base; void *base;
ret = dev_get_drvdata(dev, (unsigned long *)&data); ret = dev_get_drvdata(dev, (const void **)&data);
if (ret) if (ret)
return ret; return ret;
@ -426,7 +426,7 @@ static struct platform_device_id imx_esdctl_ids[] = {
static __maybe_unused struct of_device_id imx_esdctl_dt_ids[] = { static __maybe_unused struct of_device_id imx_esdctl_dt_ids[] = {
{ {
.compatible = "fsl,imx6q-mmdc", .compatible = "fsl,imx6q-mmdc",
.data = (unsigned long)&imx6q_data .data = &imx6q_data
}, { }, {
/* sentinel */ /* sentinel */
} }

View File

@ -395,7 +395,7 @@ static int imx_iim_probe(struct device_d *dev)
iim = xzalloc(sizeof(*iim)); iim = xzalloc(sizeof(*iim));
dev_get_drvdata(dev, (unsigned long *)&drvdata); dev_get_drvdata(dev, (const void **)&drvdata);
if (drvdata && drvdata->supply) if (drvdata && drvdata->supply)
iim->supply = drvdata->supply; iim->supply = drvdata->supply;
@ -471,13 +471,13 @@ static struct imx_iim_drvdata imx53_drvdata = {
static __maybe_unused struct of_device_id imx_iim_dt_ids[] = { static __maybe_unused struct of_device_id imx_iim_dt_ids[] = {
{ {
.compatible = "fsl,imx53-iim", .compatible = "fsl,imx53-iim",
.data = (unsigned long)&imx53_drvdata, .data = &imx53_drvdata,
}, { }, {
.compatible = "fsl,imx51-iim", .compatible = "fsl,imx51-iim",
.data = (unsigned long)&imx51_drvdata, .data = &imx51_drvdata,
}, { }, {
.compatible = "fsl,imx27-iim", .compatible = "fsl,imx27-iim",
.data = (unsigned long)&imx27_drvdata, .data = &imx27_drvdata,
}, { }, {
/* sentinel */ /* sentinel */
} }

View File

@ -86,7 +86,7 @@ static int imx_sata_probe(struct device_d *dev)
struct imx_sata_data *data; struct imx_sata_data *data;
int ret; int ret;
ret = dev_get_drvdata(dev, (unsigned long *)&data); ret = dev_get_drvdata(dev, (const void **)&data);
if (ret) if (ret)
return ret; return ret;
@ -145,10 +145,10 @@ static struct platform_device_id imx_sata_ids[] = {
static __maybe_unused struct of_device_id imx_sata_dt_ids[] = { static __maybe_unused struct of_device_id imx_sata_dt_ids[] = {
{ {
.compatible = "fsl,imx6q-ahci", .compatible = "fsl,imx6q-ahci",
.data = (unsigned long)&data_imx6, .data = &data_imx6,
}, { }, {
.compatible = "fsl,imx53-ahci", .compatible = "fsl,imx53-ahci",
.data = (unsigned long)&data_imx53, .data = &data_imx53,
}, { }, {
/* sentinel */ /* sentinel */
} }

View File

@ -404,7 +404,7 @@ void devices_shutdown(void)
} }
} }
int dev_get_drvdata(struct device_d *dev, unsigned long *data) int dev_get_drvdata(struct device_d *dev, const void **data)
{ {
if (dev->of_id_entry) { if (dev->of_id_entry) {
*data = dev->of_id_entry->data; *data = dev->of_id_entry->data;
@ -412,7 +412,7 @@ int dev_get_drvdata(struct device_d *dev, unsigned long *data)
} }
if (dev->id_entry) { if (dev->id_entry) {
*data = dev->id_entry->driver_data; *data = (const void **)dev->id_entry->driver_data;
return 0; return 0;
} }

View File

@ -48,22 +48,22 @@ static struct of_device_id weim_id_table[] = {
{ {
/* i.MX1/21 */ /* i.MX1/21 */
.compatible = "fsl,imx1-weim", .compatible = "fsl,imx1-weim",
.data = (unsigned long)&imx1_weim_devtype, .data = &imx1_weim_devtype,
}, { }, {
/* i.MX25/27/31/35 */ /* i.MX25/27/31/35 */
.compatible = "fsl,imx27-weim", .compatible = "fsl,imx27-weim",
.data = (unsigned long)&imx27_weim_devtype, .data = &imx27_weim_devtype,
}, { }, {
/* i.MX50/53/6Q */ /* i.MX50/53/6Q */
.compatible = "fsl,imx50-weim", .compatible = "fsl,imx50-weim",
.data = (unsigned long)&imx50_weim_devtype, .data = &imx50_weim_devtype,
}, { }, {
/* i.MX51 */ /* i.MX51 */
.compatible = "fsl,imx51-weim", .compatible = "fsl,imx51-weim",
.data = (unsigned long)&imx51_weim_devtype, .data = &imx51_weim_devtype,
}, { }, {
.compatible = "fsl,imx6q-weim", .compatible = "fsl,imx6q-weim",
.data = (unsigned long)&imx50_weim_devtype, .data = &imx50_weim_devtype,
}, { }, {
} }
}; };
@ -134,7 +134,7 @@ static int weim_probe(struct device_d *dev)
struct imx_weim *weim; struct imx_weim *weim;
int ret; int ret;
ret = dev_get_drvdata(dev, (unsigned long *)&devtype); ret = dev_get_drvdata(dev, (const void **)&devtype);
if (ret) if (ret)
return ret; return ret;

View File

@ -454,31 +454,31 @@ mv78xx0_mbus_data __maybe_unused = {
static struct of_device_id mvebu_mbus_dt_ids[] = { static struct of_device_id mvebu_mbus_dt_ids[] = {
#if defined(CONFIG_ARCH_ARMADA_370) || defined(CONFIG_ARCH_ARMADA_XP) #if defined(CONFIG_ARCH_ARMADA_370) || defined(CONFIG_ARCH_ARMADA_XP)
{ .compatible = "marvell,armada370-mbus", { .compatible = "marvell,armada370-mbus",
.data = (u32)&armada_370_xp_mbus_data, }, .data = &armada_370_xp_mbus_data, },
{ .compatible = "marvell,armadaxp-mbus", { .compatible = "marvell,armadaxp-mbus",
.data = (u32)&armada_370_xp_mbus_data, }, .data = &armada_370_xp_mbus_data, },
#endif #endif
#if defined(CONFIG_ARCH_DOVE) #if defined(CONFIG_ARCH_DOVE)
{ .compatible = "marvell,dove-mbus", { .compatible = "marvell,dove-mbus",
.data = (u32)&dove_mbus_data, }, .data = &dove_mbus_data, },
#endif #endif
#if defined(CONFIG_ARCH_KIRKWOOD) #if defined(CONFIG_ARCH_KIRKWOOD)
{ .compatible = "marvell,kirkwood-mbus", { .compatible = "marvell,kirkwood-mbus",
.data = (u32)&kirkwood_mbus_data, }, .data = &kirkwood_mbus_data, },
#endif #endif
#if defined(CONFIG_ARCH_ORION5X) #if defined(CONFIG_ARCH_ORION5X)
{ .compatible = "marvell,orion5x-88f5281-mbus", { .compatible = "marvell,orion5x-88f5281-mbus",
.data = (u32)&orion5x_4win_mbus_data, }, .data = &orion5x_4win_mbus_data, },
{ .compatible = "marvell,orion5x-88f5182-mbus", { .compatible = "marvell,orion5x-88f5182-mbus",
.data = (u32)&orion5x_2win_mbus_data, }, .data = &orion5x_2win_mbus_data, },
{ .compatible = "marvell,orion5x-88f5181-mbus", { .compatible = "marvell,orion5x-88f5181-mbus",
.data = (u32)&orion5x_2win_mbus_data, }, .data = &orion5x_2win_mbus_data, },
{ .compatible = "marvell,orion5x-88f6183-mbus", { .compatible = "marvell,orion5x-88f6183-mbus",
.data = (u32)&orion5x_4win_mbus_data, }, .data = &orion5x_4win_mbus_data, },
#endif #endif
#if defined(CONFIG_ARCH_MV78XX0) #if defined(CONFIG_ARCH_MV78XX0)
{ .compatible = "marvell,mv78xx0-mbus", { .compatible = "marvell,mv78xx0-mbus",
.data = (u32)&mv78xx0_mbus_data, }, .data = &mv78xx0_mbus_data, },
#endif #endif
{ }, { },
}; };

View File

@ -28,15 +28,15 @@ static struct clk_onecell_data clk_data;
static struct of_device_id mvebu_coreclk_ids[] = { static struct of_device_id mvebu_coreclk_ids[] = {
{ .compatible = "marvell,armada-370-core-clock", { .compatible = "marvell,armada-370-core-clock",
.data = (u32)&armada_370_coreclks }, .data = &armada_370_coreclks },
{ .compatible = "marvell,armada-xp-core-clock", { .compatible = "marvell,armada-xp-core-clock",
.data = (u32)&armada_xp_coreclks }, .data = &armada_xp_coreclks },
{ .compatible = "marvell,dove-core-clock", { .compatible = "marvell,dove-core-clock",
.data = (u32)&dove_coreclks }, .data = &dove_coreclks },
{ .compatible = "marvell,kirkwood-core-clock", { .compatible = "marvell,kirkwood-core-clock",
.data = (u32)&kirkwood_coreclks }, .data = &kirkwood_coreclks },
{ .compatible = "marvell,mv88f6180-core-clock", { .compatible = "marvell,mv88f6180-core-clock",
.data = (u32)&mv88f6180_coreclks }, .data = &mv88f6180_coreclks },
{ } { }
}; };
@ -139,13 +139,13 @@ static struct clk *clk_gating_get_src(
static struct of_device_id mvebu_clk_gating_ids[] = { static struct of_device_id mvebu_clk_gating_ids[] = {
{ .compatible = "marvell,armada-370-gating-clock", { .compatible = "marvell,armada-370-gating-clock",
.data = (u32)&armada_370_gating_desc }, .data = &armada_370_gating_desc },
{ .compatible = "marvell,armada-xp-gating-clock", { .compatible = "marvell,armada-xp-gating-clock",
.data = (u32)&armada_xp_gating_desc }, .data = &armada_xp_gating_desc },
{ .compatible = "marvell,dove-gating-clock", { .compatible = "marvell,dove-gating-clock",
.data = (u32)&dove_gating_desc }, .data = &dove_gating_desc },
{ .compatible = "marvell,kirkwood-gating-clock", { .compatible = "marvell,kirkwood-gating-clock",
.data = (u32)&kirkwood_gating_desc }, .data = &kirkwood_gating_desc },
{ } { }
}; };

View File

@ -593,7 +593,7 @@ static int apbh_dma_probe(struct device_d *dev)
enum mxs_dma_id id; enum mxs_dma_id id;
int ret, channel; int ret, channel;
ret = dev_get_drvdata(dev, (unsigned long *)&id); ret = dev_get_drvdata(dev, (const void **)&id);
if (ret) if (ret)
return ret; return ret;
@ -652,10 +652,10 @@ static struct platform_device_id apbh_ids[] = {
static __maybe_unused struct of_device_id apbh_dt_ids[] = { static __maybe_unused struct of_device_id apbh_dt_ids[] = {
{ {
.compatible = "fsl,imx23-dma-apbh", .compatible = "fsl,imx23-dma-apbh",
.data = (unsigned long)IMX23_DMA, .data = (void *)IMX23_DMA,
}, { }, {
.compatible = "fsl,imx28-dma-apbh", .compatible = "fsl,imx28-dma-apbh",
.data = (unsigned long)IMX28_DMA, .data = (void *)IMX28_DMA,
}, { }, {
/* sentinel */ /* sentinel */
} }

View File

@ -359,7 +359,7 @@ static int at24_probe(struct device_d *dev)
} else { } else {
unsigned long magic; unsigned long magic;
err = dev_get_drvdata(dev, (unsigned long *)&magic); err = dev_get_drvdata(dev, (const void **)&magic);
if (err) if (err)
return err; return err;

View File

@ -370,7 +370,7 @@ static int bgpio_dev_probe(struct device_d *dev)
if (err) if (err)
return err; return err;
dev_get_drvdata(dev, &flags); dev_get_drvdata(dev, (const void **)&flags);
bgc = xzalloc(sizeof(struct bgpio_chip)); bgc = xzalloc(sizeof(struct bgpio_chip));
if (!bgc) if (!bgc)

View File

@ -136,7 +136,7 @@ static int imx_gpio_probe(struct device_d *dev)
struct imx_gpio_regs *regs; struct imx_gpio_regs *regs;
int ret; int ret;
ret = dev_get_drvdata(dev, (unsigned long *)&regs); ret = dev_get_drvdata(dev, (const void **)&regs);
if (ret) if (ret)
return ret; return ret;
@ -164,28 +164,28 @@ static int imx_gpio_probe(struct device_d *dev)
static __maybe_unused struct of_device_id imx_gpio_dt_ids[] = { static __maybe_unused struct of_device_id imx_gpio_dt_ids[] = {
{ {
.compatible = "fsl,imx1-gpio", .compatible = "fsl,imx1-gpio",
.data = (unsigned long)&regs_imx1, .data = &regs_imx1,
}, { }, {
.compatible = "fsl,imx21-gpio", .compatible = "fsl,imx21-gpio",
.data = (unsigned long)&regs_imx1, .data = &regs_imx1,
}, { }, {
.compatible = "fsl,imx27-gpio", .compatible = "fsl,imx27-gpio",
.data = (unsigned long)&regs_imx1, .data = &regs_imx1,
}, { }, {
.compatible = "fsl,imx31-gpio", .compatible = "fsl,imx31-gpio",
.data = (unsigned long)&regs_imx31, .data = &regs_imx31,
}, { }, {
.compatible = "fsl,imx35-gpio", .compatible = "fsl,imx35-gpio",
.data = (unsigned long)&regs_imx31, .data = &regs_imx31,
}, { }, {
.compatible = "fsl,imx51-gpio", .compatible = "fsl,imx51-gpio",
.data = (unsigned long)&regs_imx31, .data = &regs_imx31,
}, { }, {
.compatible = "fsl,imx53-gpio", .compatible = "fsl,imx53-gpio",
.data = (unsigned long)&regs_imx31, .data = &regs_imx31,
}, { }, {
.compatible = "fsl,imx6q-gpio", .compatible = "fsl,imx6q-gpio",
.data = (unsigned long)&regs_imx31, .data = &regs_imx31,
}, { }, {
/* sentinel */ /* sentinel */
} }

View File

@ -112,7 +112,7 @@ static int mxs_gpio_probe(struct device_d *dev)
struct mxs_gpio_regs *regs; struct mxs_gpio_regs *regs;
int ret, id; int ret, id;
ret = dev_get_drvdata(dev, (unsigned long *)&regs); ret = dev_get_drvdata(dev, (const void **)&regs);
if (ret) if (ret)
return ret; return ret;
@ -150,10 +150,10 @@ static int mxs_gpio_probe(struct device_d *dev)
static __maybe_unused struct of_device_id mxs_gpio_dt_ids[] = { static __maybe_unused struct of_device_id mxs_gpio_dt_ids[] = {
{ {
.compatible = "fsl,imx23-gpio", .compatible = "fsl,imx23-gpio",
.data = (unsigned long)&regs_mxs23, .data = &regs_mxs23,
}, { }, {
.compatible = "fsl,imx28-gpio", .compatible = "fsl,imx28-gpio",
.data = (unsigned long)&regs_mxs28, .data = &regs_mxs28,
}, { }, {
/* sentinel */ /* sentinel */
} }

View File

@ -144,7 +144,7 @@ static int omap_gpio_probe(struct device_d *dev)
struct omap_gpio_chip *omapgpio; struct omap_gpio_chip *omapgpio;
struct omap_gpio_drvdata *drvdata = NULL; struct omap_gpio_drvdata *drvdata = NULL;
dev_get_drvdata(dev, (unsigned long *)&drvdata); dev_get_drvdata(dev, (const void **)&drvdata);
omapgpio = xzalloc(sizeof(*omapgpio)); omapgpio = xzalloc(sizeof(*omapgpio));
omapgpio->base = dev_request_mem_region(dev, 0); omapgpio->base = dev_request_mem_region(dev, 0);
@ -176,10 +176,10 @@ static int omap_gpio_probe(struct device_d *dev)
static __maybe_unused struct of_device_id omap_gpio_dt_ids[] = { static __maybe_unused struct of_device_id omap_gpio_dt_ids[] = {
{ {
.compatible = "ti,omap4-gpio", .compatible = "ti,omap4-gpio",
.data = (unsigned long)&gpio_omap4_drvdata, .data = &gpio_omap4_drvdata,
}, { }, {
.compatible = "ti,omap3-gpio", .compatible = "ti,omap3-gpio",
.data = (unsigned long)&gpio_omap3_drvdata, .data = &gpio_omap3_drvdata,
}, { }, {
} }
}; };

View File

@ -431,7 +431,7 @@ static int pca953x_probe(struct device_d *dev)
} else { } else {
int err; int err;
err = dev_get_drvdata(dev, &driver_data); err = dev_get_drvdata(dev, (const void **)&driver_data);
if (err) if (err)
return err; return err;

View File

@ -142,7 +142,7 @@ static int tegra_gpio_probe(struct device_d *dev)
{ {
int i, j, ret; int i, j, ret;
ret = dev_get_drvdata(dev, (unsigned long *)&config); ret = dev_get_drvdata(dev, (const void **)&config);
if (ret) { if (ret) {
dev_err(dev, "dev_get_drvdata failed: %d\n", ret); dev_err(dev, "dev_get_drvdata failed: %d\n", ret);
return ret; return ret;
@ -184,10 +184,10 @@ static struct tegra_gpio_soc_config tegra30_gpio_config = {
static __maybe_unused struct of_device_id tegra_gpio_dt_ids[] = { static __maybe_unused struct of_device_id tegra_gpio_dt_ids[] = {
{ {
.compatible = "nvidia,tegra20-gpio", .compatible = "nvidia,tegra20-gpio",
.data = (unsigned long)&tegra20_gpio_config .data = &tegra20_gpio_config
}, { }, {
.compatible = "nvidia,tegra30-gpio", .compatible = "nvidia,tegra30-gpio",
.data = (unsigned long)&tegra30_gpio_config .data = &tegra30_gpio_config
}, { }, {
/* sentinel */ /* sentinel */
}, },

View File

@ -387,22 +387,22 @@ static struct platform_device_id at91_twi_devtypes[] = {
static struct of_device_id at91_twi_dt_ids[] = { static struct of_device_id at91_twi_dt_ids[] = {
{ {
.compatible = "atmel,at91rm9200-i2c", .compatible = "atmel,at91rm9200-i2c",
.data = (unsigned long) &at91rm9200_config, .data = &at91rm9200_config,
} , { } , {
.compatible = "atmel,at91sam9260-i2c", .compatible = "atmel,at91sam9260-i2c",
.data = (unsigned long) &at91sam9260_config, .data = &at91sam9260_config,
} , { } , {
.compatible = "atmel,at91sam9261-i2c", .compatible = "atmel,at91sam9261-i2c",
.data = (unsigned long) &at91sam9261_config, .data = &at91sam9261_config,
} , { } , {
.compatible = "atmel,at91sam9g20-i2c", .compatible = "atmel,at91sam9g20-i2c",
.data = (unsigned long) &at91sam9g20_config, .data = &at91sam9g20_config,
} , { } , {
.compatible = "atmel,at91sam9g10-i2c", .compatible = "atmel,at91sam9g10-i2c",
.data = (unsigned long) &at91sam9g10_config, .data = &at91sam9g10_config,
}, { }, {
.compatible = "atmel,at91sam9x5-i2c", .compatible = "atmel,at91sam9x5-i2c",
.data = (unsigned long) &at91sam9x5_config, .data = &at91sam9x5_config,
}, { }, {
/* sentinel */ /* sentinel */
} }
@ -417,7 +417,7 @@ static int at91_twi_probe(struct device_d *dev)
i2c_at91 = xzalloc(sizeof(struct at91_twi_dev)); i2c_at91 = xzalloc(sizeof(struct at91_twi_dev));
rc = dev_get_drvdata(dev, (unsigned long *)&i2c_data); rc = dev_get_drvdata(dev, (const void **)&i2c_data);
if (rc < 0) { if (rc < 0) {
dev_err(dev, "failed to retrieve driver data\n"); dev_err(dev, "failed to retrieve driver data\n");
goto out_free; goto out_free;

View File

@ -487,9 +487,9 @@ mv64xxx_i2c_xfer(struct i2c_adapter *adap, struct i2c_msg msgs[], int num)
***************************************************************************** *****************************************************************************
*/ */
static struct of_device_id mv64xxx_i2c_of_match_table[] = { static struct of_device_id mv64xxx_i2c_of_match_table[] = {
{ .compatible = "marvell,mv64xxx-i2c", .data = (unsigned long)&mv64xxx_i2c_regs_mv64xxx}, { .compatible = "marvell,mv64xxx-i2c", .data = &mv64xxx_i2c_regs_mv64xxx},
{ .compatible = "marvell,mv78230-i2c", .data = (unsigned long)&mv64xxx_i2c_regs_mv64xxx}, { .compatible = "marvell,mv78230-i2c", .data = &mv64xxx_i2c_regs_mv64xxx},
{ .compatible = "marvell,mv78230-a0-i2c", .data = (unsigned long)&mv64xxx_i2c_regs_mv64xxx}, { .compatible = "marvell,mv78230-a0-i2c", .data = &mv64xxx_i2c_regs_mv64xxx},
{} {}
}; };
@ -574,7 +574,7 @@ mv64xxx_of_config(struct mv64xxx_i2c_data *drv_data,
goto out; goto out;
} }
dev_get_drvdata(pd, (unsigned long *)&mv64xxx_regs); dev_get_drvdata(pd, (const void **)&mv64xxx_regs);
memcpy(&drv_data->reg_offsets, mv64xxx_regs, memcpy(&drv_data->reg_offsets, mv64xxx_regs,
sizeof(drv_data->reg_offsets)); sizeof(drv_data->reg_offsets));

View File

@ -1002,7 +1002,7 @@ i2c_omap_probe(struct device_d *pdev)
goto err_free_mem; goto err_free_mem;
} }
r = dev_get_drvdata(pdev, (unsigned long *)&i2c_data); r = dev_get_drvdata(pdev, (const void **)&i2c_data);
if (r) if (r)
return r; return r;
@ -1137,7 +1137,7 @@ static struct platform_device_id omap_i2c_ids[] = {
static __maybe_unused struct of_device_id omap_i2c_dt_ids[] = { static __maybe_unused struct of_device_id omap_i2c_dt_ids[] = {
{ {
.compatible = "ti,omap3-i2c", .compatible = "ti,omap3-i2c",
.data = (unsigned long)&omap3_data, .data = &omap3_data,
}, { }, {
.compatible = "ti,omap4-i2c", .compatible = "ti,omap4-i2c",
}, { }, {

View File

@ -640,7 +640,7 @@ static int tegra_i2c_probe(struct device_d *dev)
i2c_dev->bus_clk_rate = 100000; /* default clock rate */ i2c_dev->bus_clk_rate = 100000; /* default clock rate */
i2c_dev->hw = &tegra20_i2c_hw; i2c_dev->hw = &tegra20_i2c_hw;
dev_get_drvdata(dev, (unsigned long *)&i2c_dev->hw); dev_get_drvdata(dev, (const void **)&i2c_dev->hw);
i2c_dev->is_dvc = of_device_is_compatible(dev->device_node, i2c_dev->is_dvc = of_device_is_compatible(dev->device_node,
"nvidia,tegra20-i2c-dvc"); "nvidia,tegra20-i2c-dvc");
@ -676,16 +676,16 @@ static int tegra_i2c_probe(struct device_d *dev)
static __maybe_unused struct of_device_id tegra_i2c_compatible[] = { static __maybe_unused struct of_device_id tegra_i2c_compatible[] = {
{ {
.compatible = "nvidia,tegra114-i2c", .compatible = "nvidia,tegra114-i2c",
.data = (unsigned long)&tegra114_i2c_hw, .data = &tegra114_i2c_hw,
}, { }, {
.compatible = "nvidia,tegra30-i2c", .compatible = "nvidia,tegra30-i2c",
.data = (unsigned long)&tegra30_i2c_hw, .data = &tegra30_i2c_hw,
}, { }, {
.compatible = "nvidia,tegra20-i2c", .compatible = "nvidia,tegra20-i2c",
.data = (unsigned long)&tegra20_i2c_hw, .data = &tegra20_i2c_hw,
}, { }, {
.compatible = "nvidia,tegra20-i2c-dvc", .compatible = "nvidia,tegra20-i2c-dvc",
.data = (unsigned long)&tegra20_i2c_hw, .data = &tegra20_i2c_hw,
}, { }, {
/* sentinel */ /* sentinel */
} }

View File

@ -590,7 +590,7 @@ static int omap_mmc_probe(struct device_d *dev)
unsigned long reg_ofs = 0; unsigned long reg_ofs = 0;
int ret; int ret;
ret = dev_get_drvdata(dev, (unsigned long *)&drvdata); ret = dev_get_drvdata(dev, (const void **)&drvdata);
if (!ret) if (!ret)
reg_ofs = drvdata->reg_ofs; reg_ofs = drvdata->reg_ofs;
@ -652,10 +652,10 @@ static struct platform_device_id omap_mmc_ids[] = {
static __maybe_unused struct of_device_id omap_mmc_dt_ids[] = { static __maybe_unused struct of_device_id omap_mmc_dt_ids[] = {
{ {
.compatible = "ti,omap3-hsmmc", .compatible = "ti,omap3-hsmmc",
.data = (unsigned long)&omap3_data, .data = &omap3_data,
}, { }, {
.compatible = "ti,omap4-hsmmc", .compatible = "ti,omap4-hsmmc",
.data = (unsigned long)&omap4_data, .data = &omap4_data,
}, { }, {
/* sentinel */ /* sentinel */
} }

View File

@ -325,7 +325,7 @@ static int __init mc13xxx_probe(struct device_d *dev)
if (mc_dev) if (mc_dev)
return -EBUSY; return -EBUSY;
ret = dev_get_drvdata(dev, (unsigned long *)&devtype); ret = dev_get_drvdata(dev, (const void **)&devtype);
if (ret) if (ret)
return ret; return ret;
@ -391,9 +391,9 @@ static struct platform_device_id mc13xxx_ids[] = {
}; };
static __maybe_unused struct of_device_id mc13xxx_dt_ids[] = { static __maybe_unused struct of_device_id mc13xxx_dt_ids[] = {
{ .compatible = "fsl,mc13783", .data = (ulong)&mc13783_devtype, }, { .compatible = "fsl,mc13783", .data = &mc13783_devtype, },
{ .compatible = "fsl,mc13892", .data = (ulong)&mc13892_devtype, }, { .compatible = "fsl,mc13892", .data = &mc13892_devtype, },
{ .compatible = "fsl,mc34708", .data = (ulong)&mc34708_devtype, }, { .compatible = "fsl,mc34708", .data = &mc34708_devtype, },
{ } { }
}; };

View File

@ -1242,7 +1242,7 @@ static int mxs_nand_probe(struct device_d *dev)
enum gpmi_type type; enum gpmi_type type;
int err; int err;
err = dev_get_drvdata(dev, (unsigned long *)&type); err = dev_get_drvdata(dev, (const void **)&type);
if (err) if (err)
type = GPMI_MXS; type = GPMI_MXS;
@ -1342,13 +1342,13 @@ err1:
static __maybe_unused struct of_device_id gpmi_dt_ids[] = { static __maybe_unused struct of_device_id gpmi_dt_ids[] = {
{ {
.compatible = "fsl,imx23-gpmi-nand", .compatible = "fsl,imx23-gpmi-nand",
.data = GPMI_MXS, .data = (void *)GPMI_MXS,
}, { }, {
.compatible = "fsl,imx28-gpmi-nand", .compatible = "fsl,imx28-gpmi-nand",
.data = GPMI_MXS, .data = (void *)GPMI_MXS,
}, { }, {
.compatible = "fsl,imx6q-gpmi-nand", .compatible = "fsl,imx6q-gpmi-nand",
.data = GPMI_IMX6, .data = (void *)GPMI_IMX6,
}, { }, {
/* sentinel */ /* sentinel */
} }

View File

@ -431,7 +431,7 @@ static int dwc_ether_probe(struct device_d *dev)
priv = xzalloc(sizeof(struct dw_eth_dev)); priv = xzalloc(sizeof(struct dw_eth_dev));
ret = dev_get_drvdata(dev, (unsigned long *)&drvdata); ret = dev_get_drvdata(dev, (const void **)&drvdata);
if (ret) if (ret)
return ret; return ret;
@ -489,7 +489,7 @@ static int dwc_ether_probe(struct device_d *dev)
static __maybe_unused struct of_device_id dwc_ether_compatible[] = { static __maybe_unused struct of_device_id dwc_ether_compatible[] = {
{ {
.compatible = "snps,dwmac-3.70a", .compatible = "snps,dwmac-3.70a",
.data = (unsigned long)&dwmac_370a_drvdata, .data = &dwmac_370a_drvdata,
}, { }, {
/* sentinel */ /* sentinel */
} }

View File

@ -652,7 +652,7 @@ static int fec_probe(struct device_d *dev)
enum fec_type type; enum fec_type type;
int phy_reset; int phy_reset;
ret = dev_get_drvdata(dev, (unsigned long *)&type); ret = dev_get_drvdata(dev, (const void **)&type);
if (ret) if (ret)
return ret; return ret;
@ -762,19 +762,19 @@ static void fec_remove(struct device_d *dev)
static __maybe_unused struct of_device_id imx_fec_dt_ids[] = { static __maybe_unused struct of_device_id imx_fec_dt_ids[] = {
{ {
.compatible = "fsl,imx25-fec", .compatible = "fsl,imx25-fec",
.data = FEC_TYPE_IMX27, .data = (void *)FEC_TYPE_IMX27,
}, { }, {
.compatible = "fsl,imx27-fec", .compatible = "fsl,imx27-fec",
.data = FEC_TYPE_IMX27, .data = (void *)FEC_TYPE_IMX27,
}, { }, {
.compatible = "fsl,imx28-fec", .compatible = "fsl,imx28-fec",
.data = FEC_TYPE_IMX28, .data = (void *)FEC_TYPE_IMX28,
}, { }, {
.compatible = "fsl,imx6q-fec", .compatible = "fsl,imx6q-fec",
.data = FEC_TYPE_IMX6, .data = (void *)FEC_TYPE_IMX6,
}, { }, {
.compatible = "fsl,imx6sx-fec", .compatible = "fsl,imx6sx-fec",
.data = FEC_TYPE_IMX6, .data = (void *)FEC_TYPE_IMX6,
}, { }, {
/* sentinel */ /* sentinel */
} }

View File

@ -383,10 +383,10 @@ static struct mvebu_pcie_ops __maybe_unused armada_xp_ops = {
static struct of_device_id mvebu_pcie_dt_ids[] = { static struct of_device_id mvebu_pcie_dt_ids[] = {
#if defined(CONFIG_ARCH_ARMADA_XP) #if defined(CONFIG_ARCH_ARMADA_XP)
{ .compatible = "marvell,armada-xp-pcie", .data = (u32)&armada_xp_ops, }, { .compatible = "marvell,armada-xp-pcie", .data = &armada_xp_ops, },
#endif #endif
#if defined(CONFIG_ARCH_ARMADA_370) #if defined(CONFIG_ARCH_ARMADA_370)
{ .compatible = "marvell,armada-370-pcie", .data = (u32)&armada_370_ops, }, { .compatible = "marvell,armada-370-pcie", .data = &armada_370_ops, },
#endif #endif
#if defined(CONFIG_ARCH_DOVE) #if defined(CONFIG_ARCH_DOVE)
{ .compatible = "marvell,dove-pcie", }, { .compatible = "marvell,dove-pcie", },

View File

@ -1239,13 +1239,13 @@ static const struct tegra_pcie_soc_data tegra124_pcie_data = {
static __maybe_unused struct of_device_id tegra_pcie_of_match[] = { static __maybe_unused struct of_device_id tegra_pcie_of_match[] = {
{ {
.compatible = "nvidia,tegra124-pcie", .compatible = "nvidia,tegra124-pcie",
.data = (unsigned long)&tegra124_pcie_data .data = &tegra124_pcie_data
}, { }, {
.compatible = "nvidia,tegra30-pcie", .compatible = "nvidia,tegra30-pcie",
.data = (unsigned long)&tegra30_pcie_data .data = &tegra30_pcie_data
}, { }, {
.compatible = "nvidia,tegra20-pcie", .compatible = "nvidia,tegra20-pcie",
.data = (unsigned long)&tegra20_pcie_data .data = &tegra20_pcie_data
}, { }, {
/* sentinel */ /* sentinel */
}, },
@ -1262,7 +1262,7 @@ static int tegra_pcie_probe(struct device_d *dev)
INIT_LIST_HEAD(&pcie->buses); INIT_LIST_HEAD(&pcie->buses);
INIT_LIST_HEAD(&pcie->ports); INIT_LIST_HEAD(&pcie->ports);
dev_get_drvdata(dev, (unsigned long *)&pcie->soc_data); dev_get_drvdata(dev, (const void **)&pcie->soc_data);
pcie->dev = dev; pcie->dev = dev;
err = tegra_pcie_parse_dt(pcie); err = tegra_pcie_parse_dt(pcie);

View File

@ -384,7 +384,7 @@ static struct mvebu_pinctrl_soc_info mv88f6710_pinctrl_info = {
static struct of_device_id armada_370_pinctrl_of_match[] = { static struct of_device_id armada_370_pinctrl_of_match[] = {
{ {
.compatible = "marvell,mv88f6710-pinctrl", .compatible = "marvell,mv88f6710-pinctrl",
.data = (u32)&mv88f6710_pinctrl_info, .data = &mv88f6710_pinctrl_info,
}, },
{ }, { },
}; };

View File

@ -362,9 +362,9 @@ static struct mvebu_pinctrl_soc_info armada_xp_pinctrl_info = {
}; };
static struct of_device_id armada_xp_pinctrl_of_match[] = { static struct of_device_id armada_xp_pinctrl_of_match[] = {
{ .compatible = "marvell,mv78230-pinctrl", .data = (u32)V_MV78230, }, { .compatible = "marvell,mv78230-pinctrl", .data = (void *)V_MV78230, },
{ .compatible = "marvell,mv78260-pinctrl", .data = (u32)V_MV78260, }, { .compatible = "marvell,mv78260-pinctrl", .data = (void *)V_MV78260, },
{ .compatible = "marvell,mv78460-pinctrl", .data = (u32)V_MV78460, }, { .compatible = "marvell,mv78460-pinctrl", .data = (void *)V_MV78460, },
{ }, { },
}; };

View File

@ -689,7 +689,7 @@ static struct mvebu_pinctrl_soc_info dove_pinctrl_info = {
static struct of_device_id dove_pinctrl_of_match[] = { static struct of_device_id dove_pinctrl_of_match[] = {
{ {
.compatible = "marvell,dove-pinctrl", .compatible = "marvell,dove-pinctrl",
.data = (u32)&dove_pinctrl_info .data = &dove_pinctrl_info
}, },
{ } { }
}; };

View File

@ -405,27 +405,27 @@ static struct mvebu_pinctrl_soc_info mv98dx4122_info = {
static struct of_device_id kirkwood_pinctrl_of_match[] = { static struct of_device_id kirkwood_pinctrl_of_match[] = {
{ {
.compatible = "marvell,88f6180-pinctrl", .compatible = "marvell,88f6180-pinctrl",
.data = (u32)&mv88f6180_info .data = &mv88f6180_info
}, },
{ {
.compatible = "marvell,88f6190-pinctrl", .compatible = "marvell,88f6190-pinctrl",
.data = (u32)&mv88f6190_info .data = &mv88f6190_info
}, },
{ {
.compatible = "marvell,88f6192-pinctrl", .compatible = "marvell,88f6192-pinctrl",
.data = (u32)&mv88f6192_info .data = &mv88f6192_info
}, },
{ {
.compatible = "marvell,88f6281-pinctrl", .compatible = "marvell,88f6281-pinctrl",
.data = (u32)&mv88f6281_info .data = &mv88f6281_info
}, },
{ {
.compatible = "marvell,88f6282-pinctrl", .compatible = "marvell,88f6282-pinctrl",
.data = (u32)&mv88f6282_info .data = &mv88f6282_info
}, },
{ {
.compatible = "marvell,98dx4122-pinctrl", .compatible = "marvell,98dx4122-pinctrl",
.data = (u32)&mv98dx4122_info .data = &mv98dx4122_info
}, },
{ } { }
}; };

View File

@ -380,10 +380,10 @@ static struct at91_pinctrl_mux_ops at91sam9x5_ops = {
static struct of_device_id at91_pinctrl_dt_ids[] = { static struct of_device_id at91_pinctrl_dt_ids[] = {
{ {
.compatible = "atmel,at91rm9200-pinctrl", .compatible = "atmel,at91rm9200-pinctrl",
.data = (unsigned long)&at91rm9200_ops, .data = &at91rm9200_ops,
}, { }, {
.compatible = "atmel,at91sam9x5-pinctrl", .compatible = "atmel,at91sam9x5-pinctrl",
.data = (unsigned long)&at91sam9x5_ops, .data = &at91sam9x5_ops,
}, { }, {
/* sentinel */ /* sentinel */
} }
@ -402,7 +402,7 @@ static struct at91_pinctrl_mux_ops *at91_pinctrl_get_driver_data(struct device_d
else else
ops_data = (struct at91_pinctrl_mux_ops *)match->data; ops_data = (struct at91_pinctrl_mux_ops *)match->data;
} else { } else {
rc = dev_get_drvdata(dev, (unsigned long *)&ops_data); rc = dev_get_drvdata(dev, (const void **)&ops_data);
if (rc) if (rc)
ops_data = NULL; ops_data = NULL;
} }
@ -606,10 +606,10 @@ static struct gpio_ops at91_gpio_ops = {
static struct of_device_id at91_gpio_dt_ids[] = { static struct of_device_id at91_gpio_dt_ids[] = {
{ {
.compatible = "atmel,at91rm9200-gpio", .compatible = "atmel,at91rm9200-gpio",
.data = (unsigned long)&at91rm9200_ops, .data = &at91rm9200_ops,
}, { }, {
.compatible = "atmel,at91sam9x5-gpio", .compatible = "atmel,at91sam9x5-gpio",
.data = (unsigned long)&at91sam9x5_ops, .data = &at91sam9x5_ops,
}, { }, {
/* sentinel */ /* sentinel */
}, },
@ -631,7 +631,7 @@ static int at91_gpio_probe(struct device_d *dev)
at91_gpio = &gpio_chip[alias_idx]; at91_gpio = &gpio_chip[alias_idx];
ret = dev_get_drvdata(dev, (unsigned long *)&at91_gpio->ops); ret = dev_get_drvdata(dev, (const void **)&at91_gpio->ops);
if (ret) { if (ret) {
dev_err(dev, "dev_get_drvdata failed: %d\n", ret); dev_err(dev, "dev_get_drvdata failed: %d\n", ret);
return ret; return ret;

View File

@ -517,19 +517,19 @@ static struct rockchip_pin_ctrl rk3188_pin_ctrl = {
static struct of_device_id rockchip_pinctrl_dt_match[] = { static struct of_device_id rockchip_pinctrl_dt_match[] = {
{ {
.compatible = "rockchip,rk2928-pinctrl", .compatible = "rockchip,rk2928-pinctrl",
.data = (long)&rk2928_pin_ctrl, .data = &rk2928_pin_ctrl,
}, },
{ {
.compatible = "rockchip,rk3066a-pinctrl", .compatible = "rockchip,rk3066a-pinctrl",
.data = (long)&rk3066a_pin_ctrl, .data = &rk3066a_pin_ctrl,
}, },
{ {
.compatible = "rockchip,rk3066b-pinctrl", .compatible = "rockchip,rk3066b-pinctrl",
.data = (long)&rk3066b_pin_ctrl, .data = &rk3066b_pin_ctrl,
}, },
{ {
.compatible = "rockchip,rk3188-pinctrl", .compatible = "rockchip,rk3188-pinctrl",
.data = (long)&rk3188_pin_ctrl, .data = &rk3188_pin_ctrl,
}, { }, {
/* sentinel */ /* sentinel */
} }

View File

@ -387,7 +387,7 @@ static int pinctrl_tegra_xusb_probe(struct device_d *dev)
dev->priv = padctl; dev->priv = padctl;
padctl->dev = dev; padctl->dev = dev;
dev_get_drvdata(dev, (unsigned long *)&padctl->soc); dev_get_drvdata(dev, (const void **)&padctl->soc);
padctl->regs = dev_request_mem_region(dev, 0); padctl->regs = dev_request_mem_region(dev, 0);
if (IS_ERR(padctl->regs)) { if (IS_ERR(padctl->regs)) {
@ -500,7 +500,7 @@ static const struct tegra_xusb_padctl_soc tegra124_soc = {
static __maybe_unused struct of_device_id pinctrl_tegra_xusb_dt_ids[] = { static __maybe_unused struct of_device_id pinctrl_tegra_xusb_dt_ids[] = {
{ {
.compatible = "nvidia,tegra124-xusb-padctl", .compatible = "nvidia,tegra124-xusb-padctl",
.data = (unsigned long)&tegra124_soc, .data = &tegra124_soc,
}, { }, {
/* sentinel */ /* sentinel */
} }

View File

@ -891,7 +891,7 @@ static int pinctrl_tegra30_probe(struct device_d *dev)
} }
} }
dev_get_drvdata(dev, (unsigned long *)&ctrl->drvdata); dev_get_drvdata(dev, (const void **)&ctrl->drvdata);
ctrl->pinctrl.dev = dev; ctrl->pinctrl.dev = dev;
ctrl->pinctrl.ops = &pinctrl_tegra30_ops; ctrl->pinctrl.ops = &pinctrl_tegra30_ops;
@ -911,12 +911,12 @@ static __maybe_unused struct of_device_id pinctrl_tegra30_dt_ids[] = {
{ {
#ifdef CONFIG_ARCH_TEGRA_3x_SOC #ifdef CONFIG_ARCH_TEGRA_3x_SOC
.compatible = "nvidia,tegra30-pinmux", .compatible = "nvidia,tegra30-pinmux",
.data = (unsigned long)&tegra30_drvdata, .data = &tegra30_drvdata,
}, { }, {
#endif #endif
#ifdef CONFIG_ARCH_TEGRA_124_SOC #ifdef CONFIG_ARCH_TEGRA_124_SOC
.compatible = "nvidia,tegra124-pinmux", .compatible = "nvidia,tegra124-pinmux",
.data = (unsigned long)&tegra124_drvdata, .data = &tegra124_drvdata,
}, { }, {
#endif #endif
/* sentinel */ /* sentinel */

View File

@ -205,8 +205,8 @@ static struct imx_pwm_data imx_pwm_data_v2 = {
}; };
static struct of_device_id imx_pwm_dt_ids[] = { static struct of_device_id imx_pwm_dt_ids[] = {
{ .compatible = "fsl,imx1-pwm", .data = (unsigned long)&imx_pwm_data_v1, }, { .compatible = "fsl,imx1-pwm", .data = &imx_pwm_data_v1, },
{ .compatible = "fsl,imx27-pwm", .data = (unsigned long)&imx_pwm_data_v2, }, { .compatible = "fsl,imx27-pwm", .data = &imx_pwm_data_v2, },
{ /* sentinel */ } { /* sentinel */ }
}; };
@ -216,7 +216,7 @@ static int imx_pwm_probe(struct device_d *dev)
struct imx_chip *imx; struct imx_chip *imx;
int ret = 0; int ret = 0;
ret = dev_get_drvdata(dev, (unsigned long *)&data); ret = dev_get_drvdata(dev, (const void **)&data);
if (ret) if (ret)
return ret; return ret;

View File

@ -251,7 +251,7 @@ static int ds1307_probe(struct device_d *dev)
ds1307 = xzalloc(sizeof(struct ds1307)); ds1307 = xzalloc(sizeof(struct ds1307));
err = dev_get_drvdata(dev, &driver_data); err = dev_get_drvdata(dev, (const void **)&driver_data);
if (err) if (err)
goto exit; goto exit;

View File

@ -221,7 +221,7 @@ static int cadence_serial_probe(struct device_d *dev)
struct cadence_serial_devtype_data *devtype; struct cadence_serial_devtype_data *devtype;
int ret; int ret;
ret = dev_get_drvdata(dev, (unsigned long *)&devtype); ret = dev_get_drvdata(dev, (const void **)&devtype);
if (ret) if (ret)
return ret; return ret;
@ -276,7 +276,7 @@ static void cadence_serial_remove(struct device_d *dev)
static __maybe_unused struct of_device_id cadence_serial_dt_ids[] = { static __maybe_unused struct of_device_id cadence_serial_dt_ids[] = {
{ {
.compatible = "xlnx,xuartps", .compatible = "xlnx,xuartps",
.data = (unsigned long)&cadence_r1p08_data, .data = &cadence_r1p08_data,
}, { }, {
/* sentinel */ /* sentinel */
} }

View File

@ -315,7 +315,7 @@ static int imx_serial_probe(struct device_d *dev)
int ret; int ret;
const char *devname; const char *devname;
ret = dev_get_drvdata(dev, (unsigned long *)&devtype); ret = dev_get_drvdata(dev, (const void **)&devtype);
if (ret) if (ret)
return ret; return ret;
@ -377,10 +377,10 @@ static void imx_serial_remove(struct device_d *dev)
static __maybe_unused struct of_device_id imx_serial_dt_ids[] = { static __maybe_unused struct of_device_id imx_serial_dt_ids[] = {
{ {
.compatible = "fsl,imx1-uart", .compatible = "fsl,imx1-uart",
.data = (unsigned long)&imx1_data, .data = &imx1_data,
}, { }, {
.compatible = "fsl,imx21-uart", .compatible = "fsl,imx21-uart",
.data = (unsigned long)&imx21_data, .data = &imx21_data,
}, { }, {
/* sentinel */ /* sentinel */
} }

View File

@ -399,7 +399,7 @@ static int ns16550_probe(struct device_d *dev)
struct ns16550_drvdata *devtype; struct ns16550_drvdata *devtype;
int ret; int ret;
ret = dev_get_drvdata(dev, (unsigned long *)&devtype); ret = dev_get_drvdata(dev, (const void **)&devtype);
if (ret) if (ret)
devtype = &ns16550_drvdata; devtype = &ns16550_drvdata;
@ -462,36 +462,36 @@ err:
static struct of_device_id ns16550_serial_dt_ids[] = { static struct of_device_id ns16550_serial_dt_ids[] = {
{ {
.compatible = "ns16450", .compatible = "ns16450",
.data = (unsigned long)&ns16450_drvdata, .data = &ns16450_drvdata,
}, { }, {
.compatible = "ns16550a", .compatible = "ns16550a",
.data = (unsigned long)&ns16550_drvdata, .data = &ns16550_drvdata,
}, { }, {
.compatible = "snps,dw-apb-uart", .compatible = "snps,dw-apb-uart",
.data = (unsigned long)&ns16550_drvdata, .data = &ns16550_drvdata,
}, },
#if IS_ENABLED(CONFIG_ARCH_OMAP) #if IS_ENABLED(CONFIG_ARCH_OMAP)
{ {
.compatible = "ti,omap2-uart", .compatible = "ti,omap2-uart",
.data = (unsigned long)&omap_drvdata, .data = &omap_drvdata,
}, { }, {
.compatible = "ti,omap3-uart", .compatible = "ti,omap3-uart",
.data = (unsigned long)&omap_drvdata, .data = &omap_drvdata,
}, { }, {
.compatible = "ti,omap4-uart", .compatible = "ti,omap4-uart",
.data = (unsigned long)&omap_drvdata, .data = &omap_drvdata,
}, },
#endif #endif
#if IS_ENABLED(CONFIG_ARCH_TEGRA) #if IS_ENABLED(CONFIG_ARCH_TEGRA)
{ {
.compatible = "nvidia,tegra20-uart", .compatible = "nvidia,tegra20-uart",
.data = (unsigned long)&tegra_drvdata, .data = &tegra_drvdata,
}, },
#endif #endif
#if IS_ENABLED(CONFIG_MACH_MIPS_XBURST) #if IS_ENABLED(CONFIG_MACH_MIPS_XBURST)
{ {
.compatible = "ingenic,jz4740-uart", .compatible = "ingenic,jz4740-uart",
.data = (unsigned long)&jz_drvdata, .data = &jz_drvdata,
}, },
#endif #endif
{ {

View File

@ -521,7 +521,7 @@ static int imx_spi_probe(struct device_d *dev)
struct spi_imx_devtype_data *devdata = NULL; struct spi_imx_devtype_data *devdata = NULL;
int ret; int ret;
ret = dev_get_drvdata(dev, (unsigned long *)&devdata); ret = dev_get_drvdata(dev, (const void **)&devdata);
if (ret) if (ret)
return -ENODEV; return -ENODEV;
@ -569,19 +569,19 @@ static __maybe_unused struct of_device_id imx_spi_dt_ids[] = {
#if IS_ENABLED(CONFIG_DRIVER_SPI_IMX_0_0) #if IS_ENABLED(CONFIG_DRIVER_SPI_IMX_0_0)
{ {
.compatible = "fsl,imx27-cspi", .compatible = "fsl,imx27-cspi",
.data = (unsigned long)&spi_imx_devtype_data_0_0, .data = &spi_imx_devtype_data_0_0,
}, },
#endif #endif
#if IS_ENABLED(CONFIG_DRIVER_SPI_IMX_0_7) #if IS_ENABLED(CONFIG_DRIVER_SPI_IMX_0_7)
{ {
.compatible = "fsl,imx35-cspi", .compatible = "fsl,imx35-cspi",
.data = (unsigned long)&spi_imx_devtype_data_0_7, .data = &spi_imx_devtype_data_0_7,
}, },
#endif #endif
#if IS_ENABLED(CONFIG_DRIVER_SPI_IMX_2_3) #if IS_ENABLED(CONFIG_DRIVER_SPI_IMX_2_3)
{ {
.compatible = "fsl,imx51-ecspi", .compatible = "fsl,imx51-ecspi",
.data = (unsigned long)&spi_imx_devtype_data_2_3, .data = &spi_imx_devtype_data_2_3,
}, },
#endif #endif
{ {

View File

@ -318,14 +318,14 @@ static int mvebu_spi_transfer(struct spi_device *spi, struct spi_message *msg)
static struct of_device_id mvebu_spi_dt_ids[] = { static struct of_device_id mvebu_spi_dt_ids[] = {
{ .compatible = "marvell,orion-spi", { .compatible = "marvell,orion-spi",
.data = (unsigned long)&mvebu_spi_set_baudrate }, .data = &mvebu_spi_set_baudrate },
#if defined(CONFIG_ARCH_ARMADA_370) || defined(CONFIG_ARCH_ARMADA_XP) #if defined(CONFIG_ARCH_ARMADA_370) || defined(CONFIG_ARCH_ARMADA_XP)
{ .compatible = "marvell,armada-370-xp-spi", { .compatible = "marvell,armada-370-xp-spi",
.data = (unsigned long)&armada_370_xp_spi_set_baudrate }, .data = &armada_370_xp_spi_set_baudrate },
#endif #endif
#if defined(CONFIG_ARCH_DOVE) #if defined(CONFIG_ARCH_DOVE)
{ .compatible = "marvell,dove-spi", { .compatible = "marvell,dove-spi",
.data = (unsigned long)&dove_spi_set_baudrate }, .data = &dove_spi_set_baudrate },
#endif #endif
{ } { }
}; };

View File

@ -363,7 +363,7 @@ static int omap3_spi_probe(struct device_d *dev)
struct omap_spi_drvdata *devtype; struct omap_spi_drvdata *devtype;
int ret; int ret;
ret = dev_get_drvdata(dev, (unsigned long *)&devtype); ret = dev_get_drvdata(dev, (const void **)&devtype);
if (ret) if (ret)
return ret; return ret;
@ -422,10 +422,10 @@ static struct omap_spi_drvdata omap4_data = {
static __maybe_unused struct of_device_id omap_spi_dt_ids[] = { static __maybe_unused struct of_device_id omap_spi_dt_ids[] = {
{ {
.compatible = "ti,omap2-mcspi", .compatible = "ti,omap2-mcspi",
.data = (unsigned long)&omap3_data, .data = &omap3_data,
}, { }, {
.compatible = "ti,omap4-mcspi", .compatible = "ti,omap4-mcspi",
.data = (unsigned long)&omap4_data, .data = &omap4_data,
}, { }, {
/* sentinel */ /* sentinel */
} }

View File

@ -474,43 +474,43 @@ static __maybe_unused struct of_device_id imx_usbmisc_dt_ids[] = {
#ifdef CONFIG_ARCH_IMX25 #ifdef CONFIG_ARCH_IMX25
{ {
.compatible = "fsl,imx25-usbmisc", .compatible = "fsl,imx25-usbmisc",
.data = (unsigned long)&mx25_data, .data = &mx25_data,
}, },
#endif #endif
#ifdef CONFIG_ARCH_IMX27 #ifdef CONFIG_ARCH_IMX27
{ {
.compatible = "fsl,imx27-usbmisc", .compatible = "fsl,imx27-usbmisc",
.data = (unsigned long)&mx27_mx31_data, .data = &mx27_mx31_data,
}, },
#endif #endif
#ifdef CONFIG_ARCH_IMX31 #ifdef CONFIG_ARCH_IMX31
{ {
.compatible = "fsl,imx31-usbmisc", .compatible = "fsl,imx31-usbmisc",
.data = (unsigned long)&mx27_mx31_data, .data = &mx27_mx31_data,
}, },
#endif #endif
#ifdef CONFIG_ARCH_IMX35 #ifdef CONFIG_ARCH_IMX35
{ {
.compatible = "fsl,imx35-usbmisc", .compatible = "fsl,imx35-usbmisc",
.data = (unsigned long)&mx35_data, .data = &mx35_data,
}, },
#endif #endif
#ifdef CONFIG_ARCH_IMX51 #ifdef CONFIG_ARCH_IMX51
{ {
.compatible = "fsl,imx51-usbmisc", .compatible = "fsl,imx51-usbmisc",
.data = (unsigned long)&mx5_data, .data = &mx5_data,
}, },
#endif #endif
#ifdef CONFIG_ARCH_IMX53 #ifdef CONFIG_ARCH_IMX53
{ {
.compatible = "fsl,imx53-usbmisc", .compatible = "fsl,imx53-usbmisc",
.data = (unsigned long)&mx5_data, .data = &mx5_data,
}, },
#endif #endif
#ifdef CONFIG_ARCH_IMX6 #ifdef CONFIG_ARCH_IMX6
{ {
.compatible = "fsl,imx6q-usbmisc", .compatible = "fsl,imx6q-usbmisc",
.data = (unsigned long)&mx6_data, .data = &mx6_data,
}, },
#endif #endif
{ {
@ -548,7 +548,7 @@ static int imx_usbmisc_probe(struct device_d *dev)
struct imx_usb_misc_data *devtype; struct imx_usb_misc_data *devtype;
int ret; int ret;
ret = dev_get_drvdata(dev, (unsigned long *)&devtype); ret = dev_get_drvdata(dev, (const void **)&devtype);
if (ret) if (ret)
return ret; return ret;

View File

@ -357,7 +357,7 @@ static int dsps_probe(struct device_d *dev)
struct dsps_glue *glue; struct dsps_glue *glue;
int ret; int ret;
ret = dev_get_drvdata(dev, (unsigned long *)&wrp); ret = dev_get_drvdata(dev, (const void **)&wrp);
if (ret) if (ret)
return ret; return ret;
@ -445,7 +445,7 @@ static const struct dsps_musb_wrapper am33xx_driver_data = {
static __maybe_unused struct of_device_id musb_dsps_dt_ids[] = { static __maybe_unused struct of_device_id musb_dsps_dt_ids[] = {
{ {
.compatible = "ti,musb-am33xx", .compatible = "ti,musb-am33xx",
.data = (unsigned long) &am33xx_driver_data, .data = &am33xx_driver_data,
}, { }, {
/* sentinel */ /* sentinel */
}, },

View File

@ -98,7 +98,7 @@ static const struct phy_control ctrl_am335x = {
static __maybe_unused struct of_device_id omap_control_usb_dt_ids[] = { static __maybe_unused struct of_device_id omap_control_usb_dt_ids[] = {
{ {
.compatible = "ti,am335x-usb-ctrl-module", .data = (unsigned long)&ctrl_am335x .compatible = "ti,am335x-usb-ctrl-module", .data = &ctrl_am335x
}, { }, {
/* sentinel */ /* sentinel */
}, },
@ -133,7 +133,7 @@ static int am335x_control_usb_probe(struct device_d *dev)
const struct phy_control *phy_ctrl; const struct phy_control *phy_ctrl;
int ret; int ret;
ret = dev_get_drvdata(dev, (unsigned long *)&phy_ctrl); ret = dev_get_drvdata(dev, (const void **)&phy_ctrl);
if (ret) if (ret)
return ret; return ret;

View File

@ -1125,10 +1125,10 @@ static struct imx_hdmi_data imx6dl_hdmi_data = {
static struct of_device_id imx_hdmi_dt_ids[] = { static struct of_device_id imx_hdmi_dt_ids[] = {
{ {
.compatible = "fsl,imx6q-hdmi", .compatible = "fsl,imx6q-hdmi",
.data = (unsigned long)&imx6q_hdmi_data, .data = &imx6q_hdmi_data,
}, { }, {
.compatible = "fsl,imx6dl-hdmi", .compatible = "fsl,imx6dl-hdmi",
.data = (unsigned long)&imx6dl_hdmi_data, .data = &imx6dl_hdmi_data,
}, { }, {
/* sentinel */ /* sentinel */
} }
@ -1175,7 +1175,7 @@ static int imx_hdmi_probe(struct device_d *dev)
int ret; int ret;
const struct imx_hdmi_data *devtype; const struct imx_hdmi_data *devtype;
ret = dev_get_drvdata(dev, (unsigned long *)&devtype); ret = dev_get_drvdata(dev, (const void **)&devtype);
if (ret) if (ret)
return ret; return ret;
@ -1186,7 +1186,7 @@ static int imx_hdmi_probe(struct device_d *dev)
hdmi->sample_rate = 48000; hdmi->sample_rate = 48000;
hdmi->ratio = 100; hdmi->ratio = 100;
ret = dev_get_drvdata(dev, (unsigned long *)&hdmi->dev_type); ret = dev_get_drvdata(dev, (const void **)&hdmi->dev_type);
if (ret) if (ret)
return ret; return ret;

View File

@ -249,7 +249,7 @@ static int imx_ldb_probe(struct device_d *dev)
int mapping; int mapping;
const struct imx_ldb_data *devtype; const struct imx_ldb_data *devtype;
ret = dev_get_drvdata(dev, (unsigned long *)&devtype); ret = dev_get_drvdata(dev, (const void **)&devtype);
if (ret) if (ret)
return ret; return ret;
@ -322,8 +322,8 @@ static int imx_ldb_probe(struct device_d *dev)
} }
static struct of_device_id imx_ldb_dt_ids[] = { static struct of_device_id imx_ldb_dt_ids[] = {
{ .compatible = "fsl,imx6q-ldb", (unsigned long)&imx_ldb_data_imx6q}, { .compatible = "fsl,imx6q-ldb", &imx_ldb_data_imx6q},
{ .compatible = "fsl,imx53-ldb", (unsigned long)&imx_ldb_data_imx53}, { .compatible = "fsl,imx53-ldb", &imx_ldb_data_imx53},
{ /* sentinel */ } { /* sentinel */ }
}; };

View File

@ -612,9 +612,9 @@ static struct ipu_devtype ipu_type_imx6q = {
}; };
static struct of_device_id imx_ipu_dt_ids[] = { static struct of_device_id imx_ipu_dt_ids[] = {
{ .compatible = "fsl,imx51-ipu", .data = (unsigned long)&ipu_type_imx51, }, { .compatible = "fsl,imx51-ipu", .data = &ipu_type_imx51, },
{ .compatible = "fsl,imx53-ipu", .data = (unsigned long)&ipu_type_imx53, }, { .compatible = "fsl,imx53-ipu", .data = &ipu_type_imx53, },
{ .compatible = "fsl,imx6q-ipu", .data = (unsigned long)&ipu_type_imx6q, }, { .compatible = "fsl,imx6q-ipu", .data = &ipu_type_imx6q, },
{ /* sentinel */ } { /* sentinel */ }
}; };
@ -755,7 +755,7 @@ static int ipu_probe(struct device_d *dev)
int i, ret; int i, ret;
const struct ipu_devtype *devtype; const struct ipu_devtype *devtype;
ret = dev_get_drvdata(dev, (unsigned long *)&devtype); ret = dev_get_drvdata(dev, (const void **)&devtype);
if (ret) if (ret)
return ret; return ret;

View File

@ -173,7 +173,7 @@ static int imx_wd_probe(struct device_d *dev)
void *ops; void *ops;
int ret; int ret;
ret = dev_get_drvdata(dev, (unsigned long *)&ops); ret = dev_get_drvdata(dev, (const void **)&ops);
if (ret) if (ret)
return ret; return ret;
@ -240,10 +240,10 @@ static const struct imx_wd_ops imx1_wd_ops = {
static __maybe_unused struct of_device_id imx_wdt_dt_ids[] = { static __maybe_unused struct of_device_id imx_wdt_dt_ids[] = {
{ {
.compatible = "fsl,imx1-wdt", .compatible = "fsl,imx1-wdt",
.data = (unsigned long)&imx1_wd_ops, .data = &imx1_wd_ops,
}, { }, {
.compatible = "fsl,imx21-wdt", .compatible = "fsl,imx21-wdt",
.data = (unsigned long)&imx21_wd_ops, .data = &imx21_wd_ops,
}, { }, {
/* sentinel */ /* sentinel */
} }

View File

@ -512,7 +512,7 @@ int devfs_create_partitions(const char *devname,
#define DRV_OF_COMPAT(compat) \ #define DRV_OF_COMPAT(compat) \
IS_ENABLED(CONFIG_OFDEVICE) ? (compat) : NULL IS_ENABLED(CONFIG_OFDEVICE) ? (compat) : NULL
int dev_get_drvdata(struct device_d *dev, unsigned long *data); int dev_get_drvdata(struct device_d *dev, const void **data);
int device_match_of_modalias(struct device_d *dev, struct driver_d *drv); int device_match_of_modalias(struct device_d *dev, struct driver_d *drv);

View File

@ -322,7 +322,7 @@ struct of_phandle_args;
#define CLK_OF_DECLARE(name, compat, fn) \ #define CLK_OF_DECLARE(name, compat, fn) \
const struct of_device_id __clk_of_table_##name \ const struct of_device_id __clk_of_table_##name \
__attribute__ ((unused,section (".__clk_of_table_" __stringify(name)))) \ __attribute__ ((unused,section (".__clk_of_table_" __stringify(name)))) \
= { .compatible = compat, .data = (u32)fn } = { .compatible = compat, .data = fn }
#if defined(CONFIG_OFTREE) && defined(CONFIG_COMMON_CLK_OF_PROVIDER) #if defined(CONFIG_OFTREE) && defined(CONFIG_COMMON_CLK_OF_PROVIDER)
int of_clk_add_provider(struct device_node *np, int of_clk_add_provider(struct device_node *np,

View File

@ -35,7 +35,7 @@ struct device_node {
struct of_device_id { struct of_device_id {
char *compatible; char *compatible;
unsigned long data; const void *data;
}; };
#define MAX_PHANDLE_ARGS 8 #define MAX_PHANDLE_ARGS 8