From: Pavel Machek Date: Sat, 8 Aug 2009 13:40:50 +0000 (+0200) Subject: Staging: dream: Synaptics touchscreen: check that smbus is available X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=c60adf37eb9cbb244025a0d02ba41bc7931bc674;p=openwrt%2Fstaging%2Fblogic.git Staging: dream: Synaptics touchscreen: check that smbus is available Check that SMBUS APIs are available in touchscreen driver. Signed-off-by: Pavel Machek Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/dream/synaptics_i2c_rmi.c b/drivers/staging/dream/synaptics_i2c_rmi.c index 9190a9d86c7f..ae696d3bc8e6 100644 --- a/drivers/staging/dream/synaptics_i2c_rmi.c +++ b/drivers/staging/dream/synaptics_i2c_rmi.c @@ -373,6 +373,12 @@ static int __devinit synaptics_ts_probe( goto err_check_functionality_failed; } + if (!i2c_check_functionality(client->adapter, I2C_FUNC_SMBUS_WORD_DATA)) { + pr_err("synaptics_ts_probe: need I2C_FUNC_SMBUS_WORD_DATA\n"); + ret = -ENODEV; + goto err_check_functionality_failed; + } + ts = kzalloc(sizeof(*ts), GFP_KERNEL); if (ts == NULL) { ret = -ENOMEM;