Skip to contentSkip to conversation

iio: cros_ec: Remove unused variables

PATCH In review Paolo Cretaro 2 participants 2 messages Nov 19, 2017

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 iio: cros_ec: Remove unused variables

Fix gcc warnings about variable 'ec_device' being set but not used in these files:
common/cros_ec_sensors/cros_ec_sensors.c:194:25 light/cros_ec_light_prox.c:184:25

---
 drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c | 2 --
 drivers/iio/light/cros_ec_light_prox.c               | 2 --
 2 files changed, 4 deletions(-)
drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c +0 -2
index ed8063f2da99..7d30c59da3e2 100644
@@ -191,7 +191,6 @@ static int cros_ec_sensors_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct cros_ec_dev *ec_dev = dev_get_drvdata(dev->parent);
-	struct cros_ec_device *ec_device;
 	struct iio_dev *indio_dev;
 	struct cros_ec_sensors_state *state;
 	struct iio_chan_spec *channel;
@@ -201,7 +200,6 @@ static int cros_ec_sensors_probe(struct platform_device *pdev)
 		dev_warn(&pdev->dev, "No CROS EC device found.\n");
 		return -EINVAL;
 	}
-	ec_device = ec_dev->ec_dev;
 
 	indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*state));
 	if (!indio_dev)
drivers/iio/light/cros_ec_light_prox.c +0 -2
index b2a46b390d5c..acfad4aeb27a 100644
@@ -181,7 +181,6 @@ static int cros_ec_light_prox_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct cros_ec_dev *ec_dev = dev_get_drvdata(dev->parent);
-	struct cros_ec_device *ec_device;
 	struct iio_dev *indio_dev;
 	struct cros_ec_light_prox_state *state;
 	struct iio_chan_spec *channel;
@@ -191,7 +190,6 @@ static int cros_ec_light_prox_probe(struct platform_device *pdev)
 		dev_warn(dev, "No CROS EC device found.\n");
 		return -EINVAL;
 	}
-	ec_device = ec_dev->ec_dev;
 
 	indio_dev = devm_iio_device_alloc(dev, sizeof(*state));
 	if (!indio_dev)
Signature · 1 line
2.15.0
maintainer
#1 lore raw
Quoted 6 lines · On Sun, 19 Nov 2017 01:57:45 +0100 Paolo Cretaro <[email protected]> wrote:

Fix gcc warnings about variable 'ec_device' being set but not used in these files:
common/cros_ec_sensors/cros_ec_sensors.c:194:25 light/cros_ec_light_prox.c:184:25

Applied to the togreg branch of iio.git and pushed out as testing (at some point soonish) for the autobuilders to play with it.

Thanks,

Jonathan

Quoted 45 lines
---
 drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c | 2 --
 drivers/iio/light/cros_ec_light_prox.c               | 2 --
 2 files changed, 4 deletions(-)
drivers/iio/common/cros_ec_sensors/cros_ec_sensors.c +0 -2
index ed8063f2da99..7d30c59da3e2 100644
@@ -191,7 +191,6 @@ static int cros_ec_sensors_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct cros_ec_dev *ec_dev = dev_get_drvdata(dev->parent);
-	struct cros_ec_device *ec_device;
 	struct iio_dev *indio_dev;
 	struct cros_ec_sensors_state *state;
 	struct iio_chan_spec *channel;
@@ -201,7 +200,6 @@ static int cros_ec_sensors_probe(struct platform_device *pdev)
 		dev_warn(&pdev->dev, "No CROS EC device found.\n");
 		return -EINVAL;
 	}
-	ec_device = ec_dev->ec_dev;
 
 	indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*state));
 	if (!indio_dev)
drivers/iio/light/cros_ec_light_prox.c +0 -2
index b2a46b390d5c..acfad4aeb27a 100644
@@ -181,7 +181,6 @@ static int cros_ec_light_prox_probe(struct platform_device *pdev)
 {
 	struct device *dev = &pdev->dev;
 	struct cros_ec_dev *ec_dev = dev_get_drvdata(dev->parent);
-	struct cros_ec_device *ec_device;
 	struct iio_dev *indio_dev;
 	struct cros_ec_light_prox_state *state;
 	struct iio_chan_spec *channel;
@@ -191,7 +190,6 @@ static int cros_ec_light_prox_probe(struct platform_device *pdev)
 		dev_warn(dev, "No CROS EC device found.\n");
 		return -EINVAL;
 	}
-	ec_device = ec_dev->ec_dev;
 
 	indio_dev = devm_iio_device_alloc(dev, sizeof(*state));
 	if (!indio_dev)