From patchwork Fri Apr 25 16:22:15 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 4064501 Return-Path: X-Original-To: patchwork-linux-input@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 53F509F1F4 for ; Fri, 25 Apr 2014 16:23:42 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 929D020383 for ; Fri, 25 Apr 2014 16:23:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B4F7420154 for ; Fri, 25 Apr 2014 16:23:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752126AbaDYQW1 (ORCPT ); Fri, 25 Apr 2014 12:22:27 -0400 Received: from mga02.intel.com ([134.134.136.20]:6991 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752062AbaDYQWW (ORCPT ); Fri, 25 Apr 2014 12:22:22 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP; 25 Apr 2014 09:22:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.97,927,1389772800"; d="scan'208";a="499798311" Received: from unknown (HELO smile.fi.intel.com) ([10.237.72.73]) by orsmga001.jf.intel.com with ESMTP; 25 Apr 2014 09:22:20 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.82) (envelope-from ) id 1WditG-0003zj-U9; Fri, 25 Apr 2014 19:22:18 +0300 From: Andy Shevchenko To: Linus Walleij , Dmitry Torokhov , linux-input@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH v3 1/3] Input: gpio_keys - use dev instead of pdev in gpio_keys_setup_key() Date: Fri, 25 Apr 2014 19:22:15 +0300 Message-Id: <1398442937-15309-2-git-send-email-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 1.9.2 In-Reply-To: <1398442937-15309-1-git-send-email-andriy.shevchenko@linux.intel.com> References: <1398442937-15309-1-git-send-email-andriy.shevchenko@linux.intel.com> 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;