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: 112835 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp2564634qgf; Sun, 17 Sep 2017 04:15:04 -0700 (PDT) X-Received: by 10.98.101.4 with SMTP id z4mr17034831pfb.6.1505646904595; Sun, 17 Sep 2017 04:15:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1505646904; cv=none; d=google.com; s=arc-20160816; b=af0PFHlbBlnYoWguMKbENGS0TO9Vp9Dgx5n5+Gz14JavUiFVZJUGDLmZXcGZur0ABa FjqGdxC9QeUIGFztYtTLnUjZ35kSFKtQ8yV5YqGhqK1vFM3aG/JrT/Wwi8oYttCbqouJ iq0xmzu7XMrsnk6rZO5PFQLOnBMwy8aQT/7JgQs8kd2i+MkdpQQpPBiH3VYAfB5Tr56A T/LyNYdvRljn3YSruh4GCcUomaZkbLKoLVLDtTS4RgRlgCxX0WV0T0FqROvNQBbzMRMf fDBiTDHZsyCMm9t9SVdby8NveavQ4z8Fr5ZLR3SkgnXmGWWBQLSWJ/eSu1j/LhePRVcT v8bQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=qpG5qhNuNu7pmok1/vbol2HpXfWKASl5UyNztHlUcs4=; b=cig/abKaXfGNBIQE5gzsX9tywoCOCd1JSCoywGRIY5Z7Z5/6B9eRENFhvJXDyMlrR7 /V5h5KynnGhKYRRfkC5/S+KbMuoEQozpbkHAnZUZXdpnLH5EGuhA3XGmvV25O8NllkT2 xyL61Y8ne8PahS98b40921JKdwyLdtDRImWsNUC53FMa/WyU/AQOK3YJ+J4TbDHC6WPc V/yXvxEp5cjY29DEpQbHVHekoKSIdvE9qM6DamOLuMWmE391uMEJrpNeYAnJQ9AFIq3j dJKQrhZUuquGA5TQTo81flVZNyNVbggMEAG/d1oajg9DmF7yCRb7cc+AfTvhVdLoU0P5 UNDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=kuK8XDRn; spf=pass (google.com: best guess record for domain of linux-input-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-input-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k195si3206825pgc.507.2017.09.17.04.15.04 for ; Sun, 17 Sep 2017 04:15:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-input-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=kuK8XDRn; spf=pass (google.com: best guess record for domain of linux-input-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-input-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org 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 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(-) -- 2.13.5 -- To unsubscribe from this list: send the line "unsubscribe linux-input" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html 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); }