Commit 9d8fd2a0 authored by Bartosz Golaszewski's avatar Bartosz Golaszewski Committed by Jonathan Cameron

iio: adc: xilinx: use helper variable for &pdev->dev

It's more elegant to use a helper local variable to store the address
of the underlying struct device than to dereference pdev everywhere.
Signed-off-by: default avatarBartosz Golaszewski <bgolaszewski@baylibre.com>
Tested-by: default avatarAnand Ashok Dumbre <anandash@xilinx.com>
Reviewed-by: default avatarAnand Ashok Dumbre <anandash@xilinx.com>
Link: https://lore.kernel.org/r/20201130142759.28216-2-brgl@bgdev.plSigned-off-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
parent c2b7720a
...@@ -1287,6 +1287,7 @@ static const char * const xadc_type_names[] = { ...@@ -1287,6 +1287,7 @@ static const char * const xadc_type_names[] = {
static int xadc_probe(struct platform_device *pdev) static int xadc_probe(struct platform_device *pdev)
{ {
struct device *dev = &pdev->dev;
const struct of_device_id *id; const struct of_device_id *id;
struct iio_dev *indio_dev; struct iio_dev *indio_dev;
unsigned int bipolar_mask; unsigned int bipolar_mask;
...@@ -1296,10 +1297,10 @@ static int xadc_probe(struct platform_device *pdev) ...@@ -1296,10 +1297,10 @@ static int xadc_probe(struct platform_device *pdev)
int irq; int irq;
int i; int i;
if (!pdev->dev.of_node) if (!dev->of_node)
return -ENODEV; return -ENODEV;
id = of_match_node(xadc_of_match_table, pdev->dev.of_node); id = of_match_node(xadc_of_match_table, dev->of_node);
if (!id) if (!id)
return -EINVAL; return -EINVAL;
...@@ -1307,7 +1308,7 @@ static int xadc_probe(struct platform_device *pdev) ...@@ -1307,7 +1308,7 @@ static int xadc_probe(struct platform_device *pdev)
if (irq <= 0) if (irq <= 0)
return -ENXIO; return -ENXIO;
indio_dev = devm_iio_device_alloc(&pdev->dev, sizeof(*xadc)); indio_dev = devm_iio_device_alloc(dev, sizeof(*xadc));
if (!indio_dev) if (!indio_dev)
return -ENOMEM; return -ENOMEM;
...@@ -1327,7 +1328,7 @@ static int xadc_probe(struct platform_device *pdev) ...@@ -1327,7 +1328,7 @@ static int xadc_probe(struct platform_device *pdev)
indio_dev->modes = INDIO_DIRECT_MODE; indio_dev->modes = INDIO_DIRECT_MODE;
indio_dev->info = &xadc_info; indio_dev->info = &xadc_info;
ret = xadc_parse_dt(indio_dev, pdev->dev.of_node, &conf0); ret = xadc_parse_dt(indio_dev, dev->of_node, &conf0);
if (ret) if (ret)
return ret; return ret;
...@@ -1351,7 +1352,7 @@ static int xadc_probe(struct platform_device *pdev) ...@@ -1351,7 +1352,7 @@ static int xadc_probe(struct platform_device *pdev)
} }
} }
xadc->clk = devm_clk_get(&pdev->dev, NULL); xadc->clk = devm_clk_get(dev, NULL);
if (IS_ERR(xadc->clk)) { if (IS_ERR(xadc->clk)) {
ret = PTR_ERR(xadc->clk); ret = PTR_ERR(xadc->clk);
goto err_free_samplerate_trigger; goto err_free_samplerate_trigger;
...@@ -1377,7 +1378,7 @@ static int xadc_probe(struct platform_device *pdev) ...@@ -1377,7 +1378,7 @@ static int xadc_probe(struct platform_device *pdev)
} }
ret = request_irq(xadc->irq, xadc->ops->interrupt_handler, 0, ret = request_irq(xadc->irq, xadc->ops->interrupt_handler, 0,
dev_name(&pdev->dev), indio_dev); dev_name(dev), indio_dev);
if (ret) if (ret)
goto err_clk_disable_unprepare; goto err_clk_disable_unprepare;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment