Now, this isn't quite right, but OF eliminated the classic platform device, where these functions would be declared. Nicer alternatives? --- drivers/spi/mpc52xx_psc_spi.c | 58 +++++++++++++++++++++++++++++++++++++++--- 1 file changed, 54 insertions(+), 4 deletions(-) Index: work-powerpc.git/drivers/spi/mpc52xx_psc_spi.c =================================================================== --- work-powerpc.git.orig/drivers/spi/mpc52xx_psc_spi.c +++ work-powerpc.git/drivers/spi/mpc52xx_psc_spi.c @@ -473,6 +473,58 @@ static irqreturn_t mpc52xx_psc_spi_isr(i return IRQ_NONE; } + +static void psc1_activate(u8 cs, u8 polarity) +{ + printk(KERN_ALERT "%s: %i; cs: %i, polarity: %i\n", __func__, __LINE__, cs, polarity); +} +static void psc2_activate(u8 cs, u8 polarity) +{ + printk(KERN_ALERT "%s: %i; cs: %i, polarity: %i\n", __func__, __LINE__, cs, polarity); +} +static void psc3_activate(u8 cs, u8 polarity) +{ + printk(KERN_ALERT "%s: %i; cs: %i, polarity: %i\n", __func__, __LINE__, cs, polarity); +} +static void psc6_activate(u8 cs, u8 polarity) +{ + printk(KERN_ALERT "%s: %i; cs: %i, polarity: %i\n", __func__, __LINE__, cs, polarity); +} +static void psc1_deactivate(u8 cs, u8 polarity) +{ + printk(KERN_ALERT "%s: %i; cs: %i, polarity: %i\n", __func__, __LINE__, cs, polarity); +} +static void psc2_deactivate(u8 cs, u8 polarity) +{ + printk(KERN_ALERT "%s: %i; cs: %i, polarity: %i\n", __func__, __LINE__, cs, polarity); +} +static void psc3_deactivate(u8 cs, u8 polarity) +{ + printk(KERN_ALERT "%s: %i; cs: %i, polarity: %i\n", __func__, __LINE__, cs, polarity); +} +static void psc6_deactivate(u8 cs, u8 polarity) +{ + printk(KERN_ALERT "%s: %i; cs: %i, polarity: %i\n", __func__, __LINE__, cs, polarity); +} +static void (*mpc52xx_psc_spi_activate_funs[7])(u8, u8) = { + NULL, + psc1_activate, + psc2_activate, + psc3_activate, + NULL, + NULL, + psc6_activate, +}; +static void (*mpc52xx_psc_spi_deactivate_funs[7])(u8, u8) = { + NULL, + psc1_deactivate, + psc2_deactivate, + psc3_deactivate, + NULL, + NULL, + psc6_deactivate, +}; + /* bus_num is used only for the case dev->platform_data == NULL */ static int __init mpc52xx_psc_spi_do_probe(struct device *dev, u32 regaddr, u32 size, unsigned int irq, s16 bus_num) @@ -491,10 +543,8 @@ static int __init mpc52xx_psc_spi_do_pro mps->irq = irq; if (pdata == NULL) { - dev_warn(dev, "probe called without platform data, no " - "(de)activate_cs function will be called\n"); - mps->activate_cs = NULL; - mps->deactivate_cs = NULL; + mps->activate_cs = mpc52xx_psc_spi_activate_funs[bus_num]; + mps->deactivate_cs = mpc52xx_psc_spi_deactivate_funs[bus_num]; mps->sysclk = 0; master->bus_num = bus_num; master->num_chipselect = 255;