Skip to content

Commit

Permalink
ARM: amba: make probe() functions take const id tables
Browse files Browse the repository at this point in the history
Make Primecell driver probe functions take a const pointer to their
ID tables.  Drivers should never modify their ID tables in their
probe handler.

Signed-off-by: Russell King <[email protected]>
  • Loading branch information
Russell King committed Feb 23, 2011
1 parent 394d5ae commit aa25afa
Show file tree
Hide file tree
Showing 16 changed files with 20 additions and 17 deletions.
4 changes: 2 additions & 2 deletions arch/arm/kernel/etm.c
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ static struct miscdevice etb_miscdev = {
.fops = &etb_fops,
};

static int __init etb_probe(struct amba_device *dev, struct amba_id *id)
static int __init etb_probe(struct amba_device *dev, const struct amba_id *id)
{
struct tracectx *t = &tracer;
int ret = 0;
Expand Down Expand Up @@ -530,7 +530,7 @@ static ssize_t trace_mode_store(struct kobject *kobj,
static struct kobj_attribute trace_mode_attr =
__ATTR(trace_mode, 0644, trace_mode_show, trace_mode_store);

static int __init etm_probe(struct amba_device *dev, struct amba_id *id)
static int __init etm_probe(struct amba_device *dev, const struct amba_id *id)
{
struct tracectx *t = &tracer;
int ret = 0;
Expand Down
2 changes: 1 addition & 1 deletion drivers/char/hw_random/nomadik-rng.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ static struct hwrng nmk_rng = {
.read = nmk_rng_read,
};

static int nmk_rng_probe(struct amba_device *dev, struct amba_id *id)
static int nmk_rng_probe(struct amba_device *dev, const struct amba_id *id)
{
void __iomem *base;
int ret;
Expand Down
2 changes: 1 addition & 1 deletion drivers/dma/amba-pl08x.c
Original file line number Diff line number Diff line change
Expand Up @@ -1845,7 +1845,7 @@ static inline void init_pl08x_debugfs(struct pl08x_driver_data *pl08x)
}
#endif

static int pl08x_probe(struct amba_device *adev, struct amba_id *id)
static int pl08x_probe(struct amba_device *adev, const struct amba_id *id)
{
struct pl08x_driver_data *pl08x;
const struct vendor_data *vd = id->data;
Expand Down
2 changes: 1 addition & 1 deletion drivers/dma/pl330.c
Original file line number Diff line number Diff line change
Expand Up @@ -657,7 +657,7 @@ static irqreturn_t pl330_irq_handler(int irq, void *data)
}

static int __devinit
pl330_probe(struct amba_device *adev, struct amba_id *id)
pl330_probe(struct amba_device *adev, const struct amba_id *id)
{
struct dma_pl330_platdata *pdat;
struct dma_pl330_dmac *pdmac;
Expand Down
2 changes: 1 addition & 1 deletion drivers/gpio/pl061.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ static void pl061_irq_handler(unsigned irq, struct irq_desc *desc)
desc->irq_data.chip->irq_unmask(&desc->irq_data);
}

static int pl061_probe(struct amba_device *dev, struct amba_id *id)
static int pl061_probe(struct amba_device *dev, const struct amba_id *id)
{
struct pl061_platform_data *pdata;
struct pl061_gpio *chip;
Expand Down
3 changes: 2 additions & 1 deletion drivers/input/serio/ambakmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ static void amba_kmi_close(struct serio *io)
clk_disable(kmi->clk);
}

static int __devinit amba_kmi_probe(struct amba_device *dev, struct amba_id *id)
static int __devinit amba_kmi_probe(struct amba_device *dev,
const struct amba_id *id)
{
struct amba_kmi_port *kmi;
struct serio *io;
Expand Down
3 changes: 2 additions & 1 deletion drivers/mmc/host/mmci.c
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,8 @@ static const struct mmc_host_ops mmci_ops = {
.get_cd = mmci_get_cd,
};

static int __devinit mmci_probe(struct amba_device *dev, struct amba_id *id)
static int __devinit mmci_probe(struct amba_device *dev,
const struct amba_id *id)
{
struct mmci_platform_data *plat = dev->dev.platform_data;
struct variant_data *variant = id->data;
Expand Down
2 changes: 1 addition & 1 deletion drivers/rtc/rtc-pl030.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ static const struct rtc_class_ops pl030_ops = {
.set_alarm = pl030_set_alarm,
};

static int pl030_probe(struct amba_device *dev, struct amba_id *id)
static int pl030_probe(struct amba_device *dev, const struct amba_id *id)
{
struct pl030_rtc *rtc;
int ret;
Expand Down
2 changes: 1 addition & 1 deletion drivers/rtc/rtc-pl031.c
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,7 @@ static int pl031_remove(struct amba_device *adev)
return 0;
}

static int pl031_probe(struct amba_device *adev, struct amba_id *id)
static int pl031_probe(struct amba_device *adev, const struct amba_id *id)
{
int ret;
struct pl031_local *ldata;
Expand Down
2 changes: 1 addition & 1 deletion drivers/spi/amba-pl022.c
Original file line number Diff line number Diff line change
Expand Up @@ -2021,7 +2021,7 @@ static void pl022_cleanup(struct spi_device *spi)


static int __devinit
pl022_probe(struct amba_device *adev, struct amba_id *id)
pl022_probe(struct amba_device *adev, const struct amba_id *id)
{
struct device *dev = &adev->dev;
struct pl022_ssp_controller *platform_info = adev->dev.platform_data;
Expand Down
2 changes: 1 addition & 1 deletion drivers/tty/serial/amba-pl010.c
Original file line number Diff line number Diff line change
Expand Up @@ -676,7 +676,7 @@ static struct uart_driver amba_reg = {
.cons = AMBA_CONSOLE,
};

static int pl010_probe(struct amba_device *dev, struct amba_id *id)
static int pl010_probe(struct amba_device *dev, const struct amba_id *id)
{
struct uart_amba_port *uap;
void __iomem *base;
Expand Down
2 changes: 1 addition & 1 deletion drivers/tty/serial/amba-pl011.c
Original file line number Diff line number Diff line change
Expand Up @@ -1349,7 +1349,7 @@ static struct uart_driver amba_reg = {
.cons = AMBA_CONSOLE,
};

static int pl011_probe(struct amba_device *dev, struct amba_id *id)
static int pl011_probe(struct amba_device *dev, const struct amba_id *id)
{
struct uart_amba_port *uap;
struct vendor_data *vendor = id->data;
Expand Down
2 changes: 1 addition & 1 deletion drivers/video/amba-clcd.c
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@ static int clcdfb_register(struct clcd_fb *fb)
return ret;
}

static int clcdfb_probe(struct amba_device *dev, struct amba_id *id)
static int clcdfb_probe(struct amba_device *dev, const struct amba_id *id)
{
struct clcd_board *board = dev->dev.platform_data;
struct clcd_fb *fb;
Expand Down
2 changes: 1 addition & 1 deletion drivers/watchdog/sp805_wdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ static struct miscdevice sp805_wdt_miscdev = {
};

static int __devinit
sp805_wdt_probe(struct amba_device *adev, struct amba_id *id)
sp805_wdt_probe(struct amba_device *adev, const struct amba_id *id)
{
int ret = 0;

Expand Down
2 changes: 1 addition & 1 deletion include/linux/amba/bus.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ struct amba_id {

struct amba_driver {
struct device_driver drv;
int (*probe)(struct amba_device *, struct amba_id *);
int (*probe)(struct amba_device *, const struct amba_id *);
int (*remove)(struct amba_device *);
void (*shutdown)(struct amba_device *);
int (*suspend)(struct amba_device *, pm_message_t);
Expand Down
3 changes: 2 additions & 1 deletion sound/arm/aaci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1011,7 +1011,8 @@ static unsigned int __devinit aaci_size_fifo(struct aaci *aaci)
return i;
}

static int __devinit aaci_probe(struct amba_device *dev, struct amba_id *id)
static int __devinit aaci_probe(struct amba_device *dev,
const struct amba_id *id)
{
struct aaci *aaci;
int ret, i;
Expand Down

0 comments on commit aa25afa

Please sign in to comment.