From patchwork Tue Mar 4 04:59:53 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Axel Lin X-Patchwork-Id: 3758881 X-Patchwork-Delegate: broonie@sirena.org.uk Return-Path: X-Original-To: patchwork-linux-spi@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 19AC6BF13A for ; Tue, 4 Mar 2014 05:00:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 3AA4E203DF for ; Tue, 4 Mar 2014 05:00:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 897CC203B0 for ; Tue, 4 Mar 2014 05:00:01 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756182AbaCDFAB (ORCPT ); Tue, 4 Mar 2014 00:00:01 -0500 Received: from mail-pd0-f175.google.com ([209.85.192.175]:52304 "EHLO mail-pd0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755985AbaCDFAA (ORCPT ); Tue, 4 Mar 2014 00:00:00 -0500 Received: by mail-pd0-f175.google.com with SMTP id x10so4630322pdj.34 for ; Mon, 03 Mar 2014 20:59:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:subject:from:to:cc:date:content-type :mime-version:content-transfer-encoding; bh=IlgVmma6mMnKsrOk2o9i7bA30rn4pnAzaD2yGrAvhyk=; b=IlV8dAqp4i9A6nk83Vp4TivBf8PZhG+WaP9UhDgRU2b5cz3ORXl2jfWjH5F+XvcSyr RM0vhccPhqI+FnkMXbfblePMeElr9ovSB/9V+7e2dB9L2ppmeolfkGxrVuJI0+nFx4u6 FcM23x9iYvUl74SbRg+8GSMeCG6yrsPKZNST7fUXF/zGDo1Wi1DVt2SNx5NL0DJI5pPc enEj28GFJs0Ns8OlW0pmP72qxYIjd0tUzNtPJC2luWe7Tdngr3eRZ48FdArl+ycSQjIs lRMgRn/22W9Su073D2hEf9qUGvDWXUPtWq4o95+QjtO0SaoummW+klmghXBP79qlY/ZX BFRQ== X-Gm-Message-State: ALoCoQmI55EPSwOw1zGZqHO7a1KwW8yQ8H4GQnhbjh8xp91pUsnXgOUiRZbEH7KkPhACKYhQmAoi X-Received: by 10.68.242.33 with SMTP id wn1mr7354782pbc.154.1393909199745; Mon, 03 Mar 2014 20:59:59 -0800 (PST) Received: from [192.168.0.102] (218-164-137-181.dynamic.hinet.net. [218.164.137.181]) by mx.google.com with ESMTPSA id cz3sm42653392pbc.9.2014.03.03.20.59.57 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Mon, 03 Mar 2014 20:59:58 -0800 (PST) Message-ID: <1393909193.18753.1.camel@phoenix> Subject: [PATCH] spi: clps711x: Provide label argument for devm_gpio_request From: Axel Lin To: Mark Brown Cc: Alexander Shiyan , linux-spi@vger.kernel.org Date: Tue, 04 Mar 2014 12:59:53 +0800 X-Mailer: Evolution 3.6.4-0ubuntu1 Mime-Version: 1.0 Sender: linux-spi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-spi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 label argument was removed by commit 989847967cd762 spi: clps711x: Use devm_gpio_request(), add it back. This makes it easier to know the gpio usage in /sys/kernel/debug/gpio. Also remove unnecessary gpio_is_valid() checking, devm_gpio_request() returns error if the requested gpio is invalid. Signed-off-by: Axel Lin --- drivers/spi/spi-clps711x.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/spi/spi-clps711x.c b/drivers/spi/spi-clps711x.c index 3900c31..2b60935 100644 --- a/drivers/spi/spi-clps711x.c +++ b/drivers/spi/spi-clps711x.c @@ -158,14 +158,10 @@ static int spi_clps711x_probe(struct platform_device *pdev) for (i = 0; i < master->num_chipselect; i++) { master->cs_gpios[i] = pdata->chipselect[i]; - if (!gpio_is_valid(master->cs_gpios[i])) { - dev_err(&pdev->dev, "Invalid CS GPIO %i\n", i); - ret = -EINVAL; - goto err_out; - } - if (devm_gpio_request(&pdev->dev, master->cs_gpios[i], NULL)) { + ret = devm_gpio_request(&pdev->dev, master->cs_gpios[i], + DRIVER_NAME); + if (ret) { dev_err(&pdev->dev, "Can't get CS GPIO %i\n", i); - ret = -EINVAL; goto err_out; } }