From patchwork Sat May 20 13:13:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bram Vlerick X-Patchwork-Id: 9738589 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 BA6546020A for ; Sat, 20 May 2017 13:14:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A91452859A for ; Sat, 20 May 2017 13:14:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9BAD2285A3; Sat, 20 May 2017 13:14:23 +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 516932859A for ; Sat, 20 May 2017 13:14:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755521AbdETNN5 (ORCPT ); Sat, 20 May 2017 09:13:57 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:36667 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752621AbdETNNw (ORCPT ); Sat, 20 May 2017 09:13:52 -0400 Received: by mail-wm0-f66.google.com with SMTP id k15so21728719wmh.3; Sat, 20 May 2017 06:13:51 -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=1ny4XhR+ujLRrQoqerQf3d4GvrjvJAqmWud4oQ/6Ozs=; b=RdeLCwqDp2a+95Bb60e4WZyV/bwxmRqC5zCagMvzT6htv2ZtY2Yo9wYnw5NO5+PIH6 mGO5OcFL/arHZe9CcQWuGVp8mcRqXt1po5LP+QYqvVgIKHaVmVqLuuxDfLgEx3n9pgRs EPoGG1PRZSS+wKafV7Q7yhkK3uVDcgiTuSsP47OTdVJfuRNO0UaTWFiI5EXDktRg0LFt MH+hHEW386/ITfTBORkVQhXA7QG8Z8P7HK6fqGyxP5NJygybfBkjIwvbFJjqd9KhP20i sLY1gGw5x0dfGapMfxqxuYVog0zMO7LsTxLicNx64ZBH/U//iW6ecp3H+hjKnogFEbk8 /lJg== 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=1ny4XhR+ujLRrQoqerQf3d4GvrjvJAqmWud4oQ/6Ozs=; b=mfFR0Q5pmqD/vykVLd99SjYJkDBMylmTviEcf8VwtyzrtwUU9XBzfqSHXr5KFdE1VZ JDt+j4s+aeGbIajqdV+ci9DWojATFXjvmlFbIm0MSMlMUweJdT7hKXYizWKKzus53Oj+ dSWjE1mxhSIZkKWzDsQZGSpboSIiZ0Dl+uNq46UCQfjUgVGdJhg0Rbgjo65OxeBSG/br oSwhE3j+xUjMnvgcNQ2GX18toba6d/HkhJNRxCQzMWZcxUXeOjvi9FxS5HrfEy4sdkmz s+FgpheTwSxrRuiolxyKhNZ5j0cqStEFzLBaK5AYZ6oZXsuw2z1NV5HINd6eRoPp1GmI b28w== X-Gm-Message-State: AODbwcDAXVL7hJsKXsgojTBjorBR2ii1kLdy0KPVvTJuKW09wrso62kR qW2JhvIAFYdy5g== X-Received: by 10.80.148.185 with SMTP id s54mr10820547eda.34.1495286030954; Sat, 20 May 2017 06:13:50 -0700 (PDT) Received: from localhost ([188.189.64.253]) by smtp.gmail.com with ESMTPSA id b3sm4895335ede.9.2017.05.20.06.13.49 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 20 May 2017 06:13:50 -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: Sat, 20 May 2017 15:13:25 +0200 Message-Id: <20170520131325.21049-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 --- drivers/input/mouse/gpio_mouse.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/input/mouse/gpio_mouse.c b/drivers/input/mouse/gpio_mouse.c index ced07391304b..2fc8ddaf0175 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]; @@ -155,7 +152,6 @@ static int gpio_mouse_remove(struct platform_device *pdev) 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];