From patchwork Tue Aug 20 15:34:43 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 1150270 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-i2c-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sang-engineering.com Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 46CZbx45k9z9sML for ; Wed, 21 Aug 2019 01:34:53 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730590AbfHTPev (ORCPT ); Tue, 20 Aug 2019 11:34:51 -0400 Received: from sauhun.de ([88.99.104.3]:37444 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730586AbfHTPeu (ORCPT ); Tue, 20 Aug 2019 11:34:50 -0400 Received: from localhost (p54B333DC.dip0.t-ipconnect.de [84.179.51.220]) by pokefinder.org (Postfix) with ESMTPSA id C42E82C3014; Tue, 20 Aug 2019 17:34:48 +0200 (CEST) From: Wolfram Sang To: linux-i2c@vger.kernel.org Cc: Wolfram Sang , Lee Jones , linux-kernel@vger.kernel.org Subject: [PATCH] mfd: htc-i2cpld: drop check because i2c_unregister_device() is NULL safe Date: Tue, 20 Aug 2019 17:34:43 +0200 Message-Id: <20190820153443.7812-1-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org No need to check the argument of i2c_unregister_device() because the function itself does it. Signed-off-by: Wolfram Sang --- Build tested only, buildbot is happy, too. Please apply to your tree. drivers/mfd/htc-i2cpld.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/mfd/htc-i2cpld.c b/drivers/mfd/htc-i2cpld.c index 370519af5d0b..8ad6768bd7a2 100644 --- a/drivers/mfd/htc-i2cpld.c +++ b/drivers/mfd/htc-i2cpld.c @@ -385,8 +385,7 @@ static void htcpld_unregister_chip_i2c( htcpld = platform_get_drvdata(pdev); chip = &htcpld->chip[chip_index]; - if (chip->client) - i2c_unregister_device(chip->client); + i2c_unregister_device(chip->client); } static int htcpld_register_chip_gpio(