From patchwork Wed May 22 21:08:15 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sebastian Andrzej Siewior X-Patchwork-Id: 2603651 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id BFC85DF215 for ; Wed, 22 May 2013 21:09:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757308Ab3EVVI7 (ORCPT ); Wed, 22 May 2013 17:08:59 -0400 Received: from www.linutronix.de ([62.245.132.108]:58898 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757335Ab3EVVIj (ORCPT ); Wed, 22 May 2013 17:08:39 -0400 Received: from localhost ([127.0.0.1] helo=localhost.localdomain) by Galois.linutronix.de with esmtp (Exim 4.72) (envelope-from ) id 1UfGH0-0001JO-Le; Wed, 22 May 2013 23:08:38 +0200 From: Sebastian Andrzej Siewior To: linux-iio@vger.kernel.org, linux-input@vger.kernel.org Cc: Jonathan Cameron , Dmitry Torokhov , Samuel Ortiz , Felipe Balbi , "Patil Rachna" , Sebastian Andrzej Siewior Subject: [PATCH 5/7] iio/ti_am335x_adc: remove platform_data support Date: Wed, 22 May 2013 23:08:15 +0200 Message-Id: <1369256897-25984-5-git-send-email-bigeasy@linutronix.de> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1369256897-25984-1-git-send-email-bigeasy@linutronix.de> References: <1369256897-25984-1-git-send-email-bigeasy@linutronix.de> X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1, SHORTCIRCUIT=-0.0001 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org This patch removes access to platform data mfd_tscadc_board because the platform is DT only. Signed-off-by: Sebastian Andrzej Siewior --- drivers/iio/adc/ti_am335x_adc.c | 26 ++++++++++---------------- 1 file changed, 10 insertions(+), 16 deletions(-) diff --git a/drivers/iio/adc/ti_am335x_adc.c b/drivers/iio/adc/ti_am335x_adc.c index ac78672..1baf5b4 100644 --- a/drivers/iio/adc/ti_am335x_adc.c +++ b/drivers/iio/adc/ti_am335x_adc.c @@ -29,7 +29,6 @@ #include #include -#include struct tiadc_device { struct ti_tscadc_dev *mfd_tscadc; @@ -188,13 +187,12 @@ static int tiadc_probe(struct platform_device *pdev) struct iio_dev *indio_dev; struct tiadc_device *adc_dev; struct ti_tscadc_dev *tscadc_dev = pdev->dev.platform_data; - struct mfd_tscadc_board *pdata = tscadc_dev->dev->platform_data; struct device_node *node = tscadc_dev->dev->of_node; int err; u32 val32; - if (!pdata && !node) { - dev_err(&pdev->dev, "Could not find platform data\n"); + if (!node) { + dev_err(&pdev->dev, "Could not find valid DT data.\n"); return -EINVAL; } @@ -208,18 +206,14 @@ static int tiadc_probe(struct platform_device *pdev) adc_dev->mfd_tscadc = tscadc_dev; - if (pdata) - adc_dev->channels = pdata->adc_init->adc_channels; - else { - node = of_get_child_by_name(node, "adc"); - if (!node) - return -EINVAL; - err = of_property_read_u32(node, - "ti,adc-channels", &val32); - if (err < 0) - goto err_free_device; - adc_dev->channels = val32; - } + node = of_get_child_by_name(node, "adc"); + if (!node) + return -EINVAL; + err = of_property_read_u32(node, + "ti,adc-channels", &val32); + if (err < 0) + goto err_free_device; + adc_dev->channels = val32; indio_dev->dev.parent = &pdev->dev; indio_dev->name = dev_name(&pdev->dev);