On Tuesday 08 September 2009, Barry Song wrote: > +static int __init ad714x_init(void) > +{ > +#if (defined(CONFIG_SPI) || defined(CONFIG_SPI_MODULE)) && \ > + !(defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)) > + return spi_register_driver(&ad714x_spi_driver); > +#endif > + > +#if (defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)) && \ > + !(defined(CONFIG_SPI) || defined(CONFIG_SPI_MODULE)) > + return i2c_add_driver(&ad714x_i2c_driver); > +#endif > + > +#if (defined(CONFIG_SPI) || defined(CONFIG_SPI_MODULE)) && \ > + (defined(CONFIG_I2C) || defined(CONFIG_I2C_MODULE)) > + int ret = 0; > + ret = spi_register_driver(&ad714x_spi_driver); > + if (ret) > + goto err; > + ret = i2c_add_driver(&ad714x_i2c_driver); > + if (ret) > + spi_unregister_driver(&ad714x_spi_driver); > +err: > + return ret; > +#endif > +} Ugly and error prone. You should have only one block of code not four ... Absolutely the cleanest solution adds inlined NOP stubs for I2C and SPI driver register/unregister calls, and gets rid of all that #ifdeffery; there are other solutions. -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html