From: Dirk Behme Date: Thu, 9 Nov 2006 23:25:44 +0000 (+0200) Subject: ARM: OMAP: Fix warnings in ads7846 X-Git-Tag: v2.6.19-omap1~71 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=d9e757b41a2c389014d4896498abf72abafca16a;p=linux-2.6-omap-h63xx.git ARM: OMAP: Fix warnings in ads7846 Fix various warnings warning: ignoring return value of 'device_create_file', declared with attribute warn_unused_result Signed-off-by: Dirk Behme Signed-off-by: Tony Lindgren --- diff --git a/drivers/input/touchscreen/ads7846.c b/drivers/input/touchscreen/ads7846.c index 87014aa0b5f..a47c95eef66 100644 --- a/drivers/input/touchscreen/ads7846.c +++ b/drivers/input/touchscreen/ads7846.c @@ -916,36 +916,54 @@ static int __devinit ads7846_probe(struct spi_device *spi) * use the other ADC lines a bit differently too */ if (ts->model == 7846) { - device_create_file(&spi->dev, &dev_attr_temp0); - device_create_file(&spi->dev, &dev_attr_temp1); + err = device_create_file(&spi->dev, &dev_attr_temp0); + if (err) + goto err_remove_attr7; + err = device_create_file(&spi->dev, &dev_attr_temp1); + if (err) + goto err_remove_attr6; } /* in1 == vBAT (7846), or a non-scaled ADC input */ - if (ts->model != 7845) - device_create_file(&spi->dev, &dev_attr_in1_input); + if (ts->model != 7845) { + err = device_create_file(&spi->dev, &dev_attr_in1_input); + if (err) + goto err_remove_attr5; + } /* in0 == a non-scaled ADC input */ - device_create_file(&spi->dev, &dev_attr_in0_input); + err = device_create_file(&spi->dev, &dev_attr_in0_input); + if (err) + goto err_remove_attr4; /* non-hwmon device attributes */ - device_create_file(&spi->dev, &dev_attr_pen_down); - device_create_file(&spi->dev, &dev_attr_disable); + err = device_create_file(&spi->dev, &dev_attr_pen_down); + if (err) + goto err_remove_attr3; + err = device_create_file(&spi->dev, &dev_attr_disable); + if (err) + goto err_remove_attr2; err = input_register_device(input_dev); if (err) - goto err_remove_attr; + goto err_remove_attr1; return 0; - err_remove_attr: + err_remove_attr1: device_remove_file(&spi->dev, &dev_attr_disable); + err_remove_attr2: device_remove_file(&spi->dev, &dev_attr_pen_down); + err_remove_attr3: + device_remove_file(&spi->dev, &dev_attr_in0_input); + err_remove_attr4: + if (ts->model != 7845) + device_remove_file(&spi->dev, &dev_attr_in1_input); + err_remove_attr5: if (ts->model == 7846) { device_remove_file(&spi->dev, &dev_attr_temp1); + err_remove_attr6: device_remove_file(&spi->dev, &dev_attr_temp0); } - if (ts->model != 7845) - device_remove_file(&spi->dev, &dev_attr_in1_input); - device_remove_file(&spi->dev, &dev_attr_in0_input); - + err_remove_attr7: free_irq(spi->irq, ts); err_cleanup_filter: if (ts->filter_cleanup)