From patchwork Thu Dec 21 16:37:30 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Zapolskiy X-Patchwork-Id: 852035 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-gpio-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3z2ckQ2MVVz9s7n for ; Fri, 22 Dec 2017 03:37:34 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751655AbdLUQhd (ORCPT ); Thu, 21 Dec 2017 11:37:33 -0500 Received: from mleia.com ([178.79.152.223]:44563 "EHLO mail.mleia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751828AbdLUQhd (ORCPT ); Thu, 21 Dec 2017 11:37:33 -0500 Received: from mail.mleia.com (localhost [127.0.0.1]) by mail.mleia.com (Postfix) with ESMTP id 979763E1712; Thu, 21 Dec 2017 16:40:24 +0000 (GMT) Received: from mail.mleia.com (91-159-128-161.elisa-laajakaista.fi [91.159.128.161]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.mleia.com (Postfix) with ESMTPSA id 182463E0370; Thu, 21 Dec 2017 16:40:24 +0000 (GMT) From: Vladimir Zapolskiy To: Linus Walleij Cc: linux-gpio@vger.kernel.org Subject: [PATCH] gpiolib: remove a redundant check in gpiod_to_chip() Date: Thu, 21 Dec 2017 18:37:30 +0200 Message-Id: <20171221163730.6093-1-vz@mleia.com> X-Mailer: git-send-email 2.10.2 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-49551924 X-CRM114-CacheID: sfid-20171221_164024_649088_1833CABB X-CRM114-Status: GOOD ( 10.29 ) Sender: linux-gpio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-gpio@vger.kernel.org This non-functional change slightly simplifies the implementation of gpiod_to_chip() function. Signed-off-by: Vladimir Zapolskiy --- drivers/gpio/gpiolib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpio/gpiolib.c b/drivers/gpio/gpiolib.c index 72577cd..6e19385 100644 --- a/drivers/gpio/gpiolib.c +++ b/drivers/gpio/gpiolib.c @@ -161,7 +161,7 @@ EXPORT_SYMBOL_GPL(desc_to_gpio); */ struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc) { - if (!desc || !desc->gdev || !desc->gdev->chip) + if (!desc || !desc->gdev) return NULL; return desc->gdev->chip; }