static int max7300_probe(struct i2c_client *client, const struct i2c_device_id *id) { struct max7301 *ts; int ret; if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_BYTE_DATA)) return -EIO; ts = devm_kzalloc(&client->dev, sizeof(struct max7301), GFP_KERNEL); if (!ts) return -ENOMEM; ts->read = max7300_i2c_read; ts->write = max7300_i2c_write; ts->dev = &client->dev; ret = __max730x_probe(ts); return ret; }
static int max7301_probe(struct spi_device *spi) { struct max7301 *ts; int ret; /* bits_per_word cannot be configured in platform data */ spi->bits_per_word = 16; ret = spi_setup(spi); if (ret < 0) return ret; ts = devm_kzalloc(&spi->dev, sizeof(struct max7301), GFP_KERNEL); if (!ts) return -ENOMEM; ts->read = max7301_spi_read; ts->write = max7301_spi_write; ts->dev = &spi->dev; ret = __max730x_probe(ts); return ret; }
static int __devinit max7301_probe(struct spi_device *spi) { struct max7301 *ts; int ret; spi->bits_per_word = 16; ret = spi_setup(spi); if (ret < 0) return ret; ts = kzalloc(sizeof(struct max7301), GFP_KERNEL); if (!ts) return -ENOMEM; ts->read = max7301_spi_read; ts->write = max7301_spi_write; ts->dev = &spi->dev; ret = __max730x_probe(ts); if (ret) kfree(ts); return ret; }