Received: by 10.192.165.156 with SMTP id m28csp788538imm; Wed, 11 Apr 2018 07:17:48 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/eJQvM3/jUH2iTobPp1X287mX/YvzeWbZz9H/DokJinONW1Rj2ZzO0dnb4+QayGCfU8t28 X-Received: by 10.99.143.75 with SMTP id r11mr3622913pgn.341.1523456268018; Wed, 11 Apr 2018 07:17:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1523456267; cv=none; d=google.com; s=arc-20160816; b=LCN/AfxG0T4Iy2W/szwY3bSTMfQKJ6YIcQ6brByiylpHE0s9t10jAiSMGaaYzqJB1E ReoJ8BKz5Ly7pvZ9Gj3za7euC8G27Kyk3JdoWDH6EJF6psOqxgV55k6ydhUXYTbb1LqT 3e/cNl1D7OXcw/l+OKAIvcg1Qvu/3pHiKOlS2Yw6DVojtgWAWdqHYNee+kkwg2hI3PxW Fg9lCx5pHrXjog6kpctO+oYja1Tbx94yoYjv9ZaypqNmChu7Xa/b1uMTcw336OL84yqp JKw6OFYLDHpxZEiWGLlelvVr0fcCHsz9nK1E4etsg9q6VpDnViWwK+WKQyusXT+m9vfc RtPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=ixe+ragC92ulMx+XS38l+thZqRhuNp5fSAN8cbbKt/o=; b=y0wFyla5hZTN7N4SzKMYR5eWfJAqw6ShWINZ5wux+h5rPqgBlAZi+l49Xv7eRlx5g+ hxmlSF4agbGTomSEO8tWJO5+pusB6MScG+e0SgZYqMl8OniGZZR2Afn34nbDBRxePfAw JxUypI80FpL9wTjLRWNCJpARcpt8mJ6YymvQD1VBdHFPS8lk3o9bf2N47cYcjFfBcMke Tr2AYtOX74OHuDB61wtmlsAGAIQtvr4Ozj03Waw8ATHSq1svNhdK6Q3yxFJA3K8PlEX6 Yt1eInFf50aHb6VRqxjbCyMBaXD54yuRh5KNJTHU4hY8KGIen1O/3Afz1lGeiPlvo4BV RsUg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k78si963464pfb.250.2018.04.11.07.17.09; Wed, 11 Apr 2018 07:17:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753006AbeDKOOD (ORCPT + 99 others); Wed, 11 Apr 2018 10:14:03 -0400 Received: from mail-out.m-online.net ([212.18.0.10]:55547 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751541AbeDKOOB (ORCPT ); Wed, 11 Apr 2018 10:14:01 -0400 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 40LmHX1TG1z1qv3g; Wed, 11 Apr 2018 16:14:00 +0200 (CEST) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 40LmHX15Kxz1qqyg; Wed, 11 Apr 2018 16:14:00 +0200 (CEST) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id 5GZqpIGrCm1r; Wed, 11 Apr 2018 16:13:58 +0200 (CEST) X-Auth-Info: hU56ZblLKw6fdDnRlqep5K3rx8B83O6DzNQbNzPqf8w= Received: from localhost.localdomain (85-222-111-42.dynamic.chello.pl [85.222.111.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Wed, 11 Apr 2018 16:13:58 +0200 (CEST) From: Lukasz Majewski To: Dmitry Torokhov Cc: linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, Sascha Hauer , Lukasz Majewski Subject: [PATCH 1/2] input: touchscreen mc13xxx: Make platform data optional Date: Wed, 11 Apr 2018 16:13:39 +0200 Message-Id: <20180411141340.30939-1-lukma@denx.de> X-Mailer: git-send-email 2.11.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Sascha Hauer The platform data once was optional, make it optional again. This is a first step towards device tree support for the mc13xxx touchscreen driver. Signed-off-by: Sascha Hauer Signed-off-by: Lukasz Majewski --- Changes from the original patch: - Commit message typo fixes --- drivers/input/touchscreen/mc13783_ts.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/drivers/input/touchscreen/mc13783_ts.c b/drivers/input/touchscreen/mc13783_ts.c index ef64f36c5ffc..610f10e6aadf 100644 --- a/drivers/input/touchscreen/mc13783_ts.c +++ b/drivers/input/touchscreen/mc13783_ts.c @@ -38,7 +38,8 @@ struct mc13783_ts_priv { struct mc13xxx *mc13xxx; struct delayed_work work; unsigned int sample[4]; - struct mc13xxx_ts_platform_data *touch; + u8 ato; + bool atox; }; static irqreturn_t mc13783_ts_handler(int irq, void *data) @@ -128,7 +129,7 @@ static void mc13783_ts_work(struct work_struct *work) if (mc13xxx_adc_do_conversion(priv->mc13xxx, mode, channel, - priv->touch->ato, priv->touch->atox, + priv->ato, priv->atox, priv->sample) == 0) mc13783_ts_report_sample(priv); } @@ -172,6 +173,7 @@ static void mc13783_ts_close(struct input_dev *dev) static int __init mc13783_ts_probe(struct platform_device *pdev) { struct mc13783_ts_priv *priv; + struct mc13xxx_ts_platform_data *pdata = dev_get_platdata(&pdev->dev); struct input_dev *idev; int ret = -ENOMEM; @@ -183,11 +185,10 @@ static int __init mc13783_ts_probe(struct platform_device *pdev) INIT_DELAYED_WORK(&priv->work, mc13783_ts_work); priv->mc13xxx = dev_get_drvdata(pdev->dev.parent); priv->idev = idev; - priv->touch = dev_get_platdata(&pdev->dev); - if (!priv->touch) { - dev_err(&pdev->dev, "missing platform data\n"); - ret = -ENODEV; - goto err_free_mem; + + if (pdata) { + priv->atox = pdata->atox; + priv->ato = pdata->ato; } idev->name = MC13783_TS_NAME; -- 2.11.0