From patchwork Thu Jul 20 02:41:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 9853483 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5356560392 for ; Thu, 20 Jul 2017 02:41:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E7392858F for ; Thu, 20 Jul 2017 02:41:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2321D28703; Thu, 20 Jul 2017 02:41:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A1AC62858F for ; Thu, 20 Jul 2017 02:41:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932591AbdGTClc (ORCPT ); Wed, 19 Jul 2017 22:41:32 -0400 Received: from mail-qt0-f194.google.com ([209.85.216.194]:34986 "EHLO mail-qt0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932243AbdGTClb (ORCPT ); Wed, 19 Jul 2017 22:41:31 -0400 Received: by mail-qt0-f194.google.com with SMTP id p25so2040069qtp.2 for ; Wed, 19 Jul 2017 19:41:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=6BbOPvJtI89dohKouxm1f6wRDaoHgdzpkXHCCf2EKcs=; b=I8Kf/u7Q2MVRpswSAyr/diCjUkkZfc6kmmIeFrgWnv0GauvtBWr0q2JndSO2r74CbQ Pm4rOsxz66bEpyQzEUBs0Bv3ncXAMiMpDYUHbapSgto3CFU+xVuURDIxvfLE0MhwH9Pl 7Kj0NVemttZNq/ueIL5fN8+W3h4/TjWRwx17Kx1dtysX7xqVq5Vr9NQLWV00UASIls57 w5211dYgOVWsKIytkAeiZTdLM8O4WcCmBOdzb4HhGpyCgXlAw/GhhxalGoONSaKLiLeT jThGuw68e89b1C8GBpomAWsKQsRUKY39RQ85oCACBmkIa5GPCfZ1w1iLSdLcmAknGg+A yRPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=6BbOPvJtI89dohKouxm1f6wRDaoHgdzpkXHCCf2EKcs=; b=Kiv+iIEWdIoUDMvDGYp1jPM9aW0yzTLgN64aPdVqiS7CQGmsaJMDa/fg5L0ZxEEBoK ihatrAsBYMdC5sih7urTGwLqxhdkVkUMa1ef1gzi1RpUfMqFZdyRnDcOcFqvrsmZur71 S4u+Yb6gumIa21b9IBievAf3LnD1V1b1Bl7uMgnJjcceZ3qcY4SwmAvTQsF66cxTKJop FcPBWhRRt0xGP2/K9CfGcCc9bVChHPXUzCrQO+bQumEg7PEnaMCakzKnp6QM4qNkQt5c S7b43S4Uym/55xfze0Oi/K83iHjg7SSGremy2VVzKRaq2jO28pzKKqKF9MuX1vFE/msF ifww== X-Gm-Message-State: AIVw110E8N6sttf6Rgeage9AqD/t4i9zktVS3gLICizqcCGIzM9TvTGA mxB7eWDdlnePhA== X-Received: by 10.237.43.134 with SMTP id e6mr3073742qtd.131.1500518490845; Wed, 19 Jul 2017 19:41:30 -0700 (PDT) Received: from localhost.localdomain ([189.61.213.245]) by smtp.gmail.com with ESMTPSA id w46sm1130257qtw.28.2017.07.19.19.41.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 19 Jul 2017 19:41:30 -0700 (PDT) From: Fabio Estevam To: hans.verkuil@cisco.com Cc: slongerbeam@gmail.com, mchehab@s-opensource.com, linux-media@vger.kernel.org, Fabio Estevam Subject: [PATCH] [media] ov5640: Remove unneeded gpiod NULL check Date: Wed, 19 Jul 2017 23:41:20 -0300 Message-Id: <1500518480-3568-1-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 2.7.4 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Fabio Estevam The gpiod API checks for NULL descriptors, so there is no need to duplicate the check in the driver. Signed-off-by: Fabio Estevam Acked-by: Steve Longerbeam --- drivers/media/i2c/ov5640.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/media/i2c/ov5640.c b/drivers/media/i2c/ov5640.c index 1f5b483..39a2269 100644 --- a/drivers/media/i2c/ov5640.c +++ b/drivers/media/i2c/ov5640.c @@ -1524,8 +1524,7 @@ static int ov5640_restore_mode(struct ov5640_dev *sensor) static void ov5640_power(struct ov5640_dev *sensor, bool enable) { - if (sensor->pwdn_gpio) - gpiod_set_value(sensor->pwdn_gpio, enable ? 0 : 1); + gpiod_set_value(sensor->pwdn_gpio, enable ? 0 : 1); } static void ov5640_reset(struct ov5640_dev *sensor)