From patchwork Wed Feb 19 13:21:09 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 3680971 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id BBBBABF13A for ; Wed, 19 Feb 2014 13:21:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id ABCE42016C for ; Wed, 19 Feb 2014 13:21:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 79C11201BA for ; Wed, 19 Feb 2014 13:21:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753554AbaBSNVU (ORCPT ); Wed, 19 Feb 2014 08:21:20 -0500 Received: from mga11.intel.com ([192.55.52.93]:64171 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752851AbaBSNVT (ORCPT ); Wed, 19 Feb 2014 08:21:19 -0500 Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga102.fm.intel.com with ESMTP; 19 Feb 2014 05:21:19 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,505,1389772800"; d="scan'208";a="484034836" Received: from smile.fi.intel.com ([10.237.72.73]) by fmsmga002.fm.intel.com with ESMTP; 19 Feb 2014 05:21:14 -0800 Received: from andy by smile.fi.intel.com with local (Exim 4.82) (envelope-from ) id 1WG75N-0006DE-35; Wed, 19 Feb 2014 15:21:13 +0200 From: Andy Shevchenko To: Dmitry Torokhov , Linus Walleij , linux-input@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v2 1/3] Input: gpio_keys - use dev instead of pdev in gpio_keys_setup_key() Date: Wed, 19 Feb 2014 15:21:09 +0200 Message-Id: <1392816071-23839-1-git-send-email-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 1.9.0 Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The platform device is not used in gpio_keys_setup_key(). This patch substitutes it by struct device. Signed-off-by: Andy Shevchenko --- drivers/input/keyboard/gpio_keys.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index 2db1324..209d4c6 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -424,13 +424,12 @@ out: return IRQ_HANDLED; } -static int gpio_keys_setup_key(struct platform_device *pdev, +static int gpio_keys_setup_key(struct device *dev, struct input_dev *input, struct gpio_button_data *bdata, const struct gpio_keys_button *button) { const char *desc = button->desc ? button->desc : "gpio_keys"; - struct device *dev = &pdev->dev; irq_handler_t isr; unsigned long irqflags; int irq, error; @@ -719,7 +718,7 @@ static int gpio_keys_probe(struct platform_device *pdev) input->name = pdata->name ? : pdev->name; input->phys = "gpio-keys/input0"; - input->dev.parent = &pdev->dev; + input->dev.parent = dev; input->open = gpio_keys_open; input->close = gpio_keys_close; @@ -736,7 +735,7 @@ static int gpio_keys_probe(struct platform_device *pdev) const struct gpio_keys_button *button = &pdata->buttons[i]; struct gpio_button_data *bdata = &ddata->data[i]; - error = gpio_keys_setup_key(pdev, input, bdata, button); + error = gpio_keys_setup_key(dev, input, bdata, button); if (error) goto fail2;