From patchwork Tue Oct 31 14:21:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 10034649 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 6A8EE60291 for ; Tue, 31 Oct 2017 14:22:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5D2A82895F for ; Tue, 31 Oct 2017 14:22:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5215F28B22; Tue, 31 Oct 2017 14:22:54 +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.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI 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 C6F5828B11 for ; Tue, 31 Oct 2017 14:22:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753309AbdJaOWv (ORCPT ); Tue, 31 Oct 2017 10:22:51 -0400 Received: from mga07.intel.com ([134.134.136.100]:29620 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753388AbdJaOWd (ORCPT ); Tue, 31 Oct 2017 10:22:33 -0400 Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga105.jf.intel.com with ESMTP; 31 Oct 2017 07:22:32 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,324,1505804400"; d="scan'208";a="330101926" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga004.fm.intel.com with ESMTP; 31 Oct 2017 07:22:24 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id F1F10728; Tue, 31 Oct 2017 16:21:50 +0200 (EET) From: Andy Shevchenko To: linux-i2c@vger.kernel.org, Wolfram Sang Cc: Andy Shevchenko , Jean Delvare , Guenter Roeck , linux-hwmon@vger.kernel.org Subject: [PATCH v1 09/15] hwmon: (w83781d) Remove duplicate NULL check Date: Tue, 31 Oct 2017 16:21:43 +0200 Message-Id: <20171031142149.32512-9-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.14.2 In-Reply-To: <20171031142149.32512-1-andriy.shevchenko@linux.intel.com> References: <20171031142149.32512-1-andriy.shevchenko@linux.intel.com> Sender: linux-hwmon-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-hwmon@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Since i2c_unregister_device() became NULL-aware we may remove duplicate NULL check. Cc: Jean Delvare Cc: Guenter Roeck Cc: linux-hwmon@vger.kernel.org Signed-off-by: Andy Shevchenko Reviewed-by: Jean Delvare Acked-by: Wolfram Sang --- drivers/hwmon/w83781d.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/drivers/hwmon/w83781d.c b/drivers/hwmon/w83781d.c index 246fb2365126..2b0f182daa87 100644 --- a/drivers/hwmon/w83781d.c +++ b/drivers/hwmon/w83781d.c @@ -1246,10 +1246,8 @@ w83781d_probe(struct i2c_client *client, const struct i2c_device_id *id) exit_remove_files: w83781d_remove_files(dev); - if (data->lm75[0]) - i2c_unregister_device(data->lm75[0]); - if (data->lm75[1]) - i2c_unregister_device(data->lm75[1]); + i2c_unregister_device(data->lm75[0]); + i2c_unregister_device(data->lm75[1]); return err; } @@ -1262,10 +1260,8 @@ w83781d_remove(struct i2c_client *client) hwmon_device_unregister(data->hwmon_dev); w83781d_remove_files(dev); - if (data->lm75[0]) - i2c_unregister_device(data->lm75[0]); - if (data->lm75[1]) - i2c_unregister_device(data->lm75[1]); + i2c_unregister_device(data->lm75[0]); + i2c_unregister_device(data->lm75[1]); return 0; }