summaryrefslogtreecommitdiff
path: root/drivers/iio
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2018-01-19 15:57:33 +0300
committerTakashi Iwai <tiwai@suse.de>2018-01-19 15:57:33 +0300
commitc86d95cb6b7ecda7b7d56e40c24b7d8b9bf9159a (patch)
tree3d868496a15be09dfb3a471e7b9dce24c0216d89 /drivers/iio
parent388fdb8f882af67ff8394d9420c1e0e42ba35619 (diff)
parent8f05b9c65d817dd288da5f1c6ecc134b66f8a190 (diff)
downloadlinux-c86d95cb6b7ecda7b7d56e40c24b7d8b9bf9159a.tar.xz
Merge tag 'asoc-v4.16-3' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-next
ASoC: Updates for v4.16 Some final updates for the merge window, this brings in some improvements to the ACPI GPIO handling for Intel and a bunch of fixes.
Diffstat (limited to 'drivers/iio')
-rw-r--r--drivers/iio/adc/stm32-dfsdm-adc.c13
-rw-r--r--drivers/iio/adc/stm32-dfsdm-core.c8
2 files changed, 2 insertions, 19 deletions
diff --git a/drivers/iio/adc/stm32-dfsdm-adc.c b/drivers/iio/adc/stm32-dfsdm-adc.c
index 5e871404f565..daa026d6a94f 100644
--- a/drivers/iio/adc/stm32-dfsdm-adc.c
+++ b/drivers/iio/adc/stm32-dfsdm-adc.c
@@ -1087,18 +1087,11 @@ static int stm32_dfsdm_adc_probe(struct platform_device *pdev)
struct device_node *np = dev->of_node;
const struct stm32_dfsdm_dev_data *dev_data;
struct iio_dev *iio;
- const struct of_device_id *of_id;
char *name;
int ret, irq, val;
- of_id = of_match_node(stm32_dfsdm_adc_match, np);
- if (!of_id->data) {
- dev_err(&pdev->dev, "Data associated to device is missing\n");
- return -EINVAL;
- }
-
- dev_data = (const struct stm32_dfsdm_dev_data *)of_id->data;
+ dev_data = of_device_get_match_data(dev);
iio = devm_iio_device_alloc(dev, sizeof(*adc));
if (!iio) {
dev_err(dev, "%s: Failed to allocate IIO\n", __func__);
@@ -1106,10 +1099,6 @@ static int stm32_dfsdm_adc_probe(struct platform_device *pdev)
}
adc = iio_priv(iio);
- if (IS_ERR(adc)) {
- dev_err(dev, "%s: Failed to allocate ADC\n", __func__);
- return PTR_ERR(adc);
- }
adc->dfsdm = dev_get_drvdata(dev->parent);
iio->dev.parent = dev;
diff --git a/drivers/iio/adc/stm32-dfsdm-core.c b/drivers/iio/adc/stm32-dfsdm-core.c
index 6cd655f8239b..6290332cfd3f 100644
--- a/drivers/iio/adc/stm32-dfsdm-core.c
+++ b/drivers/iio/adc/stm32-dfsdm-core.c
@@ -242,7 +242,6 @@ MODULE_DEVICE_TABLE(of, stm32_dfsdm_of_match);
static int stm32_dfsdm_probe(struct platform_device *pdev)
{
struct dfsdm_priv *priv;
- const struct of_device_id *of_id;
const struct stm32_dfsdm_dev_data *dev_data;
struct stm32_dfsdm *dfsdm;
int ret;
@@ -253,13 +252,8 @@ static int stm32_dfsdm_probe(struct platform_device *pdev)
priv->pdev = pdev;
- of_id = of_match_node(stm32_dfsdm_of_match, pdev->dev.of_node);
- if (!of_id->data) {
- dev_err(&pdev->dev, "Data associated to device is missing\n");
- return -EINVAL;
- }
+ dev_data = of_device_get_match_data(&pdev->dev);
- dev_data = (const struct stm32_dfsdm_dev_data *)of_id->data;
dfsdm = &priv->dfsdm;
dfsdm->fl_list = devm_kcalloc(&pdev->dev, dev_data->num_filters,
sizeof(*dfsdm->fl_list), GFP_KERNEL);