From patchwork Fri May 19 15:35:02 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bram Vlerick X-Patchwork-Id: 9737435 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 E2B28601C2 for ; Fri, 19 May 2017 15:35:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EBF0528735 for ; Fri, 19 May 2017 15:35:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DE9AB288A9; Fri, 19 May 2017 15:35:11 +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_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, 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 7F9A128735 for ; Fri, 19 May 2017 15:35:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752475AbdESPfK (ORCPT ); Fri, 19 May 2017 11:35:10 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:35802 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751073AbdESPfJ (ORCPT ); Fri, 19 May 2017 11:35:09 -0400 Received: by mail-wm0-f66.google.com with SMTP id v4so19050693wmb.2; Fri, 19 May 2017 08:35:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=daoVAafYnXyGpsiJLS6irPZQhHMqryjboA4y1idAD5E=; b=haPIs395rViMSBEcNmiREN3Brmnf02RBuejVTgSPN2iC3v4e1zemp+h2kyAvYO8ro0 clyXbIST5PmmevimBcDixV4ZQOx0/0AxB6+Y2PHdyRkeHO0GvK1vYgxHWq1THLmfYEPf MI/WzqIpN3jTrRDC8iblWYB0pfDCHbATXsMXUHGIK/YSyVzB6Yh6sEGc4BdIyOM/lWBY Ws656wKEYGRrw3DSGq1A9Vmukjycztjbek8RzIyIWt0RcO5ttdJFGPhrDsNWSiyFOdCF 7/LukK/GCUcmpP8cuE1FdVa8sKSX+5JPdJq/tD6HRrr6q+Ax5Oi737BIGxraSv8nWMdK t1IQ== 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; bh=daoVAafYnXyGpsiJLS6irPZQhHMqryjboA4y1idAD5E=; b=a0s6Fyo4yLhYArU95Me1xy/AduDCvsV6+Z4+LvSXsbqar54kyf3zGGOyqw/Zg3a52u nnfHbIU6QjtS84WtrVuZ6dYXQrpdyeQi6g9JLkSVL9hTqPFKKu0IkIE6i93CwUiELfMH UbvFVABwxE6BQ+KuHDQES6l/+WTGeM4jQ0rYSfVVR1prBjMA3wiGlC9ESCRQpHcCssMj Y/msQAhX0Yi02fsagkSU5a8xJsRJmrbq84QVgi4Uh6lvWw26htpTm0i0q8Fn7443Kt04 Np4N+I0vBrUYzmkjTAlTCWiRCRrZN8yM1mOSjbaQQtbtIzjCy1aAihqqf9hC0YCd8zYz GFag== X-Gm-Message-State: AODbwcCAm7AtpEY/77zV/dGclOakQhS9dokXvPXExTAL9+aS0aycNnOS R97lHVmmIotpDA== X-Received: by 10.28.220.86 with SMTP id t83mr19964086wmg.66.1495208107856; Fri, 19 May 2017 08:35:07 -0700 (PDT) Received: from localhost (a2176-0490160833.pck.nerim.net. [213.41.134.21]) by smtp.gmail.com with ESMTPSA id u4sm10084901wmu.0.2017.05.19.08.35.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 19 May 2017 08:35:07 -0700 (PDT) From: Bram Vlerick To: dmitry.torokhov@gmail.com, michael.opdenacker@free-electrons.com Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] input: move gpio mouse to managed api Date: Fri, 19 May 2017 17:35:02 +0200 Message-Id: <20170519153502.28570-1-vlerickb@gmail.com> X-Mailer: git-send-email 2.12.2 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 Signed-off-by: Bram Vlerick Reviewed-by: Michael Opdenacker --- drivers/input/mouse/gpio_mouse.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/drivers/input/mouse/gpio_mouse.c b/drivers/input/mouse/gpio_mouse.c index ced07391304b..7d56fd5173bc 100644 --- a/drivers/input/mouse/gpio_mouse.c +++ b/drivers/input/mouse/gpio_mouse.c @@ -93,7 +93,7 @@ static int gpio_mouse_probe(struct platform_device *pdev) } } - input_poll = input_allocate_polled_device(); + input_poll = devm_input_allocate_polled_device(&pdev->dev); if (!input_poll) { dev_err(&pdev->dev, "not enough memory for input device\n"); error = -ENOMEM; @@ -124,7 +124,7 @@ static int gpio_mouse_probe(struct platform_device *pdev) error = input_register_polled_device(input_poll); if (error) { dev_err(&pdev->dev, "could not register input device\n"); - goto out_free_polldev; + goto out_free_gpios; } dev_dbg(&pdev->dev, "%d ms scan time, buttons: %s%s%s\n", @@ -135,9 +135,6 @@ static int gpio_mouse_probe(struct platform_device *pdev) return 0; - out_free_polldev: - input_free_polled_device(input_poll); - out_free_gpios: while (--i >= 0) { pin = pdata->pins[i]; @@ -154,9 +151,6 @@ static int gpio_mouse_remove(struct platform_device *pdev) struct gpio_mouse_platform_data *pdata = 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]; if (pin >= 0)