From patchwork Sun Sep 17 11:14:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 9954763 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id F077660208 for ; Sun, 17 Sep 2017 11:15:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E522728B47 for ; Sun, 17 Sep 2017 11:15:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DA04B28B4D; Sun, 17 Sep 2017 11:15:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 284A928B52 for ; Sun, 17 Sep 2017 11:15:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750803AbdIQLPD (ORCPT ); Sun, 17 Sep 2017 07:15:03 -0400 Received: from mail-lf0-f43.google.com ([209.85.215.43]:54131 "EHLO mail-lf0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750793AbdIQLPD (ORCPT ); Sun, 17 Sep 2017 07:15:03 -0400 Received: by mail-lf0-f43.google.com with SMTP id k9so5652040lfe.10 for ; Sun, 17 Sep 2017 04:15:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=EdVR2duwb53s0pWO62hSBrmUQnUJhGMagabVabXNh7Q=; b=kuK8XDRnnxF7rA+hyZ6rKlZZwLdo8CdpMzbB53YApaJaS5LVCt8qkb13cmz/SiGjx+ stWSSG5Ain5VtrYUqsmWbehH4B8J6ffv2EaBleb+nE8I+auhOVZPDM05tWr7ab3vLWUE uQ0ywygfgUA9zIqLBAs4pRLSgishC3V04UzYM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=EdVR2duwb53s0pWO62hSBrmUQnUJhGMagabVabXNh7Q=; b=hFhoFRpcqBD8bN8+h/+ZO8mB09bhPYjrmMhtUYaI26ZChHVA8L/iXODxHvwY4rZ17q dvYFALTT/qWJceSa+F/31rMrJ0zxmlM5/yhIMVfMFENZyEezNAj4hvfuWU9ObCD6m+/f tJDQIqFl34BHJP9cpdoXBGjR56EnR5NEL4y64/TATx+M020zE0ZuGshJFx1zTvtjvAgy W2WQJL+CK72PUaGw42wWl7ovr6XFQLF8CAhajH0mtpv6xYrK0MtvcTdSSrb0dcyv7HWh mZD+1KDsLmY4tWh6e5Vb6UnVqv01AjtYIPraCQHBA3ctL6HnhKpFjExoXRLgM8/AkzSw eYMA== X-Gm-Message-State: AHPjjUiZwGkyb5GQoymCP8+C9d0/3RnWkDzBpS9MAbdNyDgAN7ME5Lu2 IXTaAD/LZke46y5UXDCVJg== X-Google-Smtp-Source: AOwi7QC+34aB8BHH6qMmscB08U2BhcQ6cAKTvHROaPiliz4HEinvDdVLyMgNnBhS7MDlHDLoBgeuuA== X-Received: by 10.46.13.18 with SMTP id 18mr12193645ljn.25.1505646901344; Sun, 17 Sep 2017 04:15:01 -0700 (PDT) Received: from fabina.bredbandsbolaget.se (c-2209e055.014-348-6c756e10.cust.bredbandsbolaget.se. [85.224.9.34]) by smtp.gmail.com with ESMTPSA id h83sm1007069lfi.16.2017.09.17.04.15.00 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 17 Sep 2017 04:15:00 -0700 (PDT) From: Linus Walleij To: Dmitry Torokhov , linux-input@vger.kernel.org, Hans-Christian Noren Egtvedt Cc: Linus Walleij Subject: [PATCH 2/5] input: mouse: Rename GPIO mouse variables Date: Sun, 17 Sep 2017 13:14:42 +0200 Message-Id: <20170917111445.30880-3-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170917111445.30880-1-linus.walleij@linaro.org> References: <20170917111445.30880-1-linus.walleij@linaro.org> Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use more apropriate names for the "platform data" which is now just a simple state container for the GPIO mouse. Signed-off-by: Linus Walleij --- drivers/input/mouse/gpio_mouse.c | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/drivers/input/mouse/gpio_mouse.c b/drivers/input/mouse/gpio_mouse.c index dcaba1e4fffb..d1914bb3531f 100644 --- a/drivers/input/mouse/gpio_mouse.c +++ b/drivers/input/mouse/gpio_mouse.c @@ -26,7 +26,7 @@ #define GPIO_MOUSE_PIN_MAX 7 /** - * struct gpio_mouse_platform_data + * struct gpio_mouse * @scan_ms: integer in ms specifying the scan periode. * @polarity: Pin polarity, active high or low. * @up: GPIO line for up value. @@ -42,7 +42,7 @@ * It is used by the gpio_mouse driver to setup GPIO lines and to * calculate mouse movement. */ -struct gpio_mouse_platform_data { +struct gpio_mouse { int scan_ms; int polarity; @@ -67,7 +67,7 @@ struct gpio_mouse_platform_data { */ static void gpio_mouse_scan(struct input_polled_dev *dev) { - struct gpio_mouse_platform_data *gpio = dev->private; + struct gpio_mouse *gpio = dev->private; struct input_dev *input = dev->input; int x, y; @@ -94,24 +94,24 @@ static void gpio_mouse_scan(struct input_polled_dev *dev) static int gpio_mouse_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - struct gpio_mouse_platform_data *pdata; + struct gpio_mouse *gmouse; struct input_polled_dev *input_poll; struct input_dev *input; int pin, i; int error; - pdata = devm_kzalloc(dev, sizeof(*pdata), GFP_KERNEL); - if (!pdata) + gmouse = devm_kzalloc(dev, sizeof(*gmouse), GFP_KERNEL); + if (!gmouse) return -ENOMEM; - if (pdata->scan_ms < 0) { + if (gmouse->scan_ms < 0) { dev_err(&pdev->dev, "invalid scan time\n"); error = -EINVAL; goto out; } for (i = 0; i < GPIO_MOUSE_PIN_MAX; i++) { - pin = pdata->pins[i]; + pin = gmouse->pins[i]; if (pin < 0) { @@ -148,9 +148,9 @@ static int gpio_mouse_probe(struct platform_device *pdev) platform_set_drvdata(pdev, input_poll); /* set input-polldev handlers */ - input_poll->private = pdata; + input_poll->private = gmouse; input_poll->poll = gpio_mouse_scan; - input_poll->poll_interval = pdata->scan_ms; + input_poll->poll_interval = gmouse->scan_ms; input = input_poll->input; input->name = pdev->name; @@ -159,11 +159,11 @@ static int gpio_mouse_probe(struct platform_device *pdev) input_set_capability(input, EV_REL, REL_X); input_set_capability(input, EV_REL, REL_Y); - if (pdata->bleft >= 0) + if (gmouse->bleft >= 0) input_set_capability(input, EV_KEY, BTN_LEFT); - if (pdata->bmiddle >= 0) + if (gmouse->bmiddle >= 0) input_set_capability(input, EV_KEY, BTN_MIDDLE); - if (pdata->bright >= 0) + if (gmouse->bright >= 0) input_set_capability(input, EV_KEY, BTN_RIGHT); error = input_register_polled_device(input_poll); @@ -173,10 +173,10 @@ static int gpio_mouse_probe(struct platform_device *pdev) } dev_dbg(&pdev->dev, "%d ms scan time, buttons: %s%s%s\n", - pdata->scan_ms, - pdata->bleft < 0 ? "" : "left ", - pdata->bmiddle < 0 ? "" : "middle ", - pdata->bright < 0 ? "" : "right"); + gmouse->scan_ms, + gmouse->bleft < 0 ? "" : "left ", + gmouse->bmiddle < 0 ? "" : "middle ", + gmouse->bright < 0 ? "" : "right"); return 0; @@ -185,7 +185,7 @@ static int gpio_mouse_probe(struct platform_device *pdev) out_free_gpios: while (--i >= 0) { - pin = pdata->pins[i]; + pin = gmouse->pins[i]; if (pin) gpio_free(pin); } @@ -196,14 +196,14 @@ static int gpio_mouse_probe(struct platform_device *pdev) static int gpio_mouse_remove(struct platform_device *pdev) { struct input_polled_dev *input = platform_get_drvdata(pdev); - struct gpio_mouse_platform_data *pdata = input->private; + struct gpio_mouse *gmouse = input->private; int pin, i; input_unregister_polled_device(input); input_free_polled_device(input); for (i = 0; i < GPIO_MOUSE_PIN_MAX; i++) { - pin = pdata->pins[i]; + pin = gmouse->pins[i]; if (pin >= 0) gpio_free(pin); }