Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1569748 > unrolled thread
| Started by | William Breathitt Gray <vilhelm.gray@gmail.com> |
|---|---|
| First post | 2017-01-30 15:00 +0100 |
| Last post | 2017-01-30 21:10 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] iio: stx104: Remove unneeded struct stx104_dev code William Breathitt Gray <vilhelm.gray@gmail.com> - 2017-01-30 15:00 +0100
Re: [PATCH] iio: stx104: Remove unneeded struct stx104_dev code Jonathan Cameron <jic23@kernel.org> - 2017-01-30 21:10 +0100
| From | William Breathitt Gray <vilhelm.gray@gmail.com> |
|---|---|
| Date | 2017-01-30 15:00 +0100 |
| Subject | [PATCH] iio: stx104: Remove unneeded struct stx104_dev code |
| Message-ID | <t5kEV-4Ed-9@gated-at.bofh.it> |
The stx104_dev structure was used to hold private data for use in the
stx104_remove function. Now that the stx104_remove function is gone, the
stx104_dev structure and relevant code is no longer needed. This patch
removes the unnecessary code.
Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
---
drivers/iio/adc/stx104.c | 19 -------------------
1 file changed, 19 deletions(-)
diff --git a/drivers/iio/adc/stx104.c b/drivers/iio/adc/stx104.c
index c56ff286695d..fcfad51cc4fb 100644
--- a/drivers/iio/adc/stx104.c
+++ b/drivers/iio/adc/stx104.c
@@ -76,16 +76,6 @@ struct stx104_gpio {
unsigned int out_state;
};
-/**
- * struct stx104_dev - STX104 device private data structure
- * @indio_dev: IIO device
- * @chip: instance of the gpio_chip
- */
-struct stx104_dev {
- struct iio_dev *indio_dev;
- struct gpio_chip *chip;
-};
-
static int stx104_read_raw(struct iio_dev *indio_dev,
struct iio_chan_spec const *chan, int *val, int *val2, long mask)
{
@@ -271,7 +261,6 @@ static int stx104_probe(struct device *dev, unsigned int id)
struct iio_dev *indio_dev;
struct stx104_iio *priv;
struct stx104_gpio *stx104gpio;
- struct stx104_dev *stx104dev;
int err;
indio_dev = devm_iio_device_alloc(dev, sizeof(*priv));
@@ -282,10 +271,6 @@ static int stx104_probe(struct device *dev, unsigned int id)
if (!stx104gpio)
return -ENOMEM;
- stx104dev = devm_kzalloc(dev, sizeof(*stx104dev), GFP_KERNEL);
- if (!stx104dev)
- return -ENOMEM;
-
if (!devm_request_region(dev, base[id], STX104_EXTENT,
dev_name(dev))) {
dev_err(dev, "Unable to lock port addresses (0x%X-0x%X)\n",
@@ -335,10 +320,6 @@ static int stx104_probe(struct device *dev, unsigned int id)
spin_lock_init(&stx104gpio->lock);
- stx104dev->indio_dev = indio_dev;
- stx104dev->chip = &stx104gpio->chip;
- dev_set_drvdata(dev, stx104dev);
-
err = devm_gpiochip_add_data(dev, &stx104gpio->chip, stx104gpio);
if (err) {
dev_err(dev, "GPIO registering failed (%d)\n", err);
--
2.11.0
[toc] | [next] | [standalone]
| From | Jonathan Cameron <jic23@kernel.org> |
|---|---|
| Date | 2017-01-30 21:10 +0100 |
| Message-ID | <t5qqZ-8nj-7@gated-at.bofh.it> |
| In reply to | #1569748 |
On 30/01/17 13:58, William Breathitt Gray wrote:
> The stx104_dev structure was used to hold private data for use in the
> stx104_remove function. Now that the stx104_remove function is gone, the
> stx104_dev structure and relevant code is no longer needed. This patch
> removes the unnecessary code.
>
> Signed-off-by: William Breathitt Gray <vilhelm.gray@gmail.com>
Applied to the togreg branch of iio.git and pushed out as testing for
the autobuilders to play with it.
Thanks,
Jonathan
> ---
> drivers/iio/adc/stx104.c | 19 -------------------
> 1 file changed, 19 deletions(-)
>
> diff --git a/drivers/iio/adc/stx104.c b/drivers/iio/adc/stx104.c
> index c56ff286695d..fcfad51cc4fb 100644
> --- a/drivers/iio/adc/stx104.c
> +++ b/drivers/iio/adc/stx104.c
> @@ -76,16 +76,6 @@ struct stx104_gpio {
> unsigned int out_state;
> };
>
> -/**
> - * struct stx104_dev - STX104 device private data structure
> - * @indio_dev: IIO device
> - * @chip: instance of the gpio_chip
> - */
> -struct stx104_dev {
> - struct iio_dev *indio_dev;
> - struct gpio_chip *chip;
> -};
> -
> static int stx104_read_raw(struct iio_dev *indio_dev,
> struct iio_chan_spec const *chan, int *val, int *val2, long mask)
> {
> @@ -271,7 +261,6 @@ static int stx104_probe(struct device *dev, unsigned int id)
> struct iio_dev *indio_dev;
> struct stx104_iio *priv;
> struct stx104_gpio *stx104gpio;
> - struct stx104_dev *stx104dev;
> int err;
>
> indio_dev = devm_iio_device_alloc(dev, sizeof(*priv));
> @@ -282,10 +271,6 @@ static int stx104_probe(struct device *dev, unsigned int id)
> if (!stx104gpio)
> return -ENOMEM;
>
> - stx104dev = devm_kzalloc(dev, sizeof(*stx104dev), GFP_KERNEL);
> - if (!stx104dev)
> - return -ENOMEM;
> -
> if (!devm_request_region(dev, base[id], STX104_EXTENT,
> dev_name(dev))) {
> dev_err(dev, "Unable to lock port addresses (0x%X-0x%X)\n",
> @@ -335,10 +320,6 @@ static int stx104_probe(struct device *dev, unsigned int id)
>
> spin_lock_init(&stx104gpio->lock);
>
> - stx104dev->indio_dev = indio_dev;
> - stx104dev->chip = &stx104gpio->chip;
> - dev_set_drvdata(dev, stx104dev);
> -
> err = devm_gpiochip_add_data(dev, &stx104gpio->chip, stx104gpio);
> if (err) {
> dev_err(dev, "GPIO registering failed (%d)\n", err);
>
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web