From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752411AbbCXKWo (ORCPT ); Tue, 24 Mar 2015 06:22:44 -0400 Received: from mail-oi0-f41.google.com ([209.85.218.41]:34095 "EHLO mail-oi0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752263AbbCXKWl (ORCPT ); Tue, 24 Mar 2015 06:22:41 -0400 MIME-Version: 1.0 In-Reply-To: <1427118025-4380-1-git-send-email-robert.dolca@intel.com> References: <1427118025-4380-1-git-send-email-robert.dolca@intel.com> Date: Tue, 24 Mar 2015 11:22:40 +0100 Message-ID: Subject: Re: [PATCH] IIO: Adds ACPI support for ST gyroscopes From: Linus Walleij To: Robert Dolca Cc: "linux-iio@vger.kernel.org" , Jonathan Cameron , "linux-kernel@vger.kernel.org" , Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald , Denis CIOCCA Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Mar 23, 2015 at 2:40 PM, Robert Dolca wrote: > Signed-off-by: Robert Dolca That's a very terse commit message. > + /* Get IRQ GPIO */ > + gpiod_irq = devm_gpiod_get_index(&client->dev, 0, 0); > + if (IS_ERR(gpiod_irq)) > + return -ENODEV; > + > + /* Configure IRQ GPIO */ > + ret = gpiod_direction_input(gpiod_irq); > + if (ret) > + return ret; Why issue two calls when one is enough. And don't discard the nice return code. Do this instead: gpiod_irq = devm_gpiod_get_index(&client->dev, 0, 0, GPIOD_IN); if (IS_ERR(gpiod_irq)) return PTR_ERR(gpiod_irq); Yours, Linus Walleij