From patchwork Mon Sep 25 16:34:27 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 114175 Delivered-To: patch@linaro.org Received: by 10.140.106.117 with SMTP id d108csp2803833qgf; Mon, 25 Sep 2017 09:34:46 -0700 (PDT) X-Received: by 10.99.124.67 with SMTP id l3mr8047202pgn.296.1506357286337; Mon, 25 Sep 2017 09:34:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1506357286; cv=none; d=google.com; s=arc-20160816; b=h8AfuD4DngmsiPY6awYBcMPbdLeLR49Xq+ZfOYXHXN6I67zFnC6pxhKZv93dcC/dQ9 74K6+bai69zMmVbrkjDZccjlmarDvYqutNBDj2Zfbjp8bGPxNQuyR5+4m7XUOciz9we6 YeMgy/NNtc9kHCejbubY3ZZ/KesO/UyDY0iMlk8DtxIElf4MVkeLSwbjowWbj6GW/vSV PERkLb115f+USdYhZ6CC78RkKkf40G8WVkE+jxRbT0hqiRVo4qo0CtwHt8V6au+TsmXM wBkAPKBPf90YSX0HtmJeXC5DfGn9s+6C2kdipWceDBkcM9gNx31IKQOt8QmYWor1/n3I D0xg== 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=++WXVuk/eGYEkxr5LB5txQk0BtE4Q2fKOmN/nsC0QJ4=; b=rv0fBLZVYOh5U+VqFSA6qTLcfHNArOzp4QlxKjgdu20XrQ5aCTKARn9lH/Ingw4NIL BmuK6bsDeScqMpwKKD07wYkBOgoElHapXmH3DveEkBP2JboXGfPQPNfGhHIVq6YQgQmE CSPrIlD0zq3oBXx4jT3yTN9YO+qi0UyzpU4BnadVI9WWz9rBIEV6GHHNGyA+GlmSGOj3 98LwTzoqeiwYZcSDxiSMXt4JU7LqIqjuZE11N9yFx66KtUZ4BpGy9hvqMKDFULIBv5PF cnYIpK+71gXFRZEOlWe/TbCW9EgOlGqz9XNZDYQH6OHBsy0RuMrQLUF8MO9KPD/mOWFs MbGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=dWC1uVcy; 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 y11si3806375pfi.187.2017.09.25.09.34.46 for ; Mon, 25 Sep 2017 09:34:46 -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=dWC1uVcy; 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 S965158AbdIYQen (ORCPT ); Mon, 25 Sep 2017 12:34:43 -0400 Received: from mail-pg0-f49.google.com ([74.125.83.49]:48085 "EHLO mail-pg0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965206AbdIYQem (ORCPT ); Mon, 25 Sep 2017 12:34:42 -0400 Received: by mail-pg0-f49.google.com with SMTP id d8so4269949pgt.4 for ; Mon, 25 Sep 2017 09:34:42 -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=q9kWirE1j7bgWzMMXfN0WB65WOr/Lq+22gcPQtKhpSU=; b=dWC1uVcyXqojHIy9SBhCLdrRlt9++JDT3c+tsLe/65Jiq/TmJ1jJSqzth8yzhm7Hre gOx8u3gVBi65LnqBeG5pmcgLxQGQSDT4BRZI5ADK1aVjwCg/yOOlwC9iwEZnkCrhntNH kqVXVSwegAdPECSuvG9b+Cq9MtYRiPb9A6Tig= 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=q9kWirE1j7bgWzMMXfN0WB65WOr/Lq+22gcPQtKhpSU=; b=WFnF0hGStKqTRA1xqWS/JRigMI0vsGbTpyixNEzOGmo0TjJ+nKn1IKMZWt9+3z/zSg 4bnjTKckMQrxu85fQGeSG+3r+x7sxylt5H35n97H9C+INK1zph1gE+hrv2ltcbRk//5+ otAELcVAmbNqdG21Z5X7rWY8FIQiAmX8Y0PjMrOPhv3Uz9bxxekdYjje/WUaYBykkh5G JqRm47VSxqzvYJ8g70vMw4lojhUaD/lGTt9x+BIOnkJG11jVDx5puXPmeE9573OIeZ7K rivCrQ3SOHNQLgxetxcC25UvZKIssrbnyhqdBRoTsqNVV9FkQ30eHTt+TxdQcDEPPKwD r/bA== X-Gm-Message-State: AHPjjUjNhm0iM7CWa4S4s3g/o1J+a2mDxFc0RNAoaGOUWdXqajquyhU5 5p5ABESbZ4/DpArVsLS/+FvWRA== X-Google-Smtp-Source: AOwi7QCwSnZFCHiC80uEL5ojQulusnSSrWKIaNFxXbjYiSs7ohYsBbAh3gtElEozL1MhFEcHz70ikA== X-Received: by 10.98.78.203 with SMTP id c194mr8216962pfb.152.1506357281852; Mon, 25 Sep 2017 09:34:41 -0700 (PDT) Received: from localhost.localdomain ([70.35.39.2]) by smtp.gmail.com with ESMTPSA id j1sm12004413pfc.169.2017.09.25.09.34.40 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 25 Sep 2017 09:34:40 -0700 (PDT) From: Linus Walleij To: Dmitry Torokhov , linux-input@vger.kernel.org Cc: Hans-Christian Noren Egtvedt , Linus Walleij Subject: [PATCH 2/5 v2] input: mouse: Rename GPIO mouse variables Date: Mon, 25 Sep 2017 18:34:27 +0200 Message-Id: <20170925163430.22397-2-linus.walleij@linaro.org> X-Mailer: git-send-email 2.13.5 In-Reply-To: <20170925163430.22397-1-linus.walleij@linaro.org> References: <20170925163430.22397-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. Acked-by: Hans-Christian Noren Egtvedt Signed-off-by: Linus Walleij --- ChangeLog v1->v2: - Collect Hand-Christian's ACK. --- 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); }