From patchwork Wed Apr 15 14:06:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tang Bin X-Patchwork-Id: 11491325 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 465EF92C for ; Wed, 15 Apr 2020 14:05:50 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 24B05206A2 for ; Wed, 15 Apr 2020 14:05:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="lpq19ynq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 24B05206A2 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=cmss.chinamobile.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=xHiAz2or7xX/HeW5apSJBrnffxyw5YNFZYTaiJ3A9wI=; b=lpq19ynqXDmPXY hukhMDxJ8c5NJ/Kw96TVAhZimmyQ1HmbQwEFkdqeAVPKRxQB7WoLI+5JDkH16RcJvoVXtBktPPaA5 RTiJ4JhxWRHxGnTL7Of7KQf9S9qG52AVhVltAgSkIAu9obX57GxD9Srl3nbn3fsn94e49HG7/iMtC 8uC4AjEd3vo1lM46ViQVBqj96/XKG31fyJq16Z6dWBG7VLIKy9aTImFSu9vbSHxx2eJ8UKegqmK5w pyg/+AdJp14fT/txJcQBDlf6nMOMHBbKrAkFmitk5XjqQZ4ZeDxJp633lbaZxMQn5NB0QSuFVcIGe UVZ3sJefopYdHzmFbB+Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jOifg-0000H1-SC; Wed, 15 Apr 2020 14:05:44 +0000 Received: from cmccmta2.chinamobile.com ([221.176.66.80]) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jOifZ-0000Fr-Sv for linux-arm-kernel@lists.infradead.org; Wed, 15 Apr 2020 14:05:43 +0000 Received: from spf.mail.chinamobile.com (unknown[172.16.121.13]) by rmmx-syy-dmz-app05-12005 (RichMail) with SMTP id 2ee55e971487913-6db1a; Wed, 15 Apr 2020 22:04:56 +0800 (CST) X-RM-TRANSID: 2ee55e971487913-6db1a X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from localhost.localdomain (unknown[112.3.208.246]) by rmsmtp-syy-appsvr07-12007 (RichMail) with SMTP id 2ee75e97148659f-b8795; Wed, 15 Apr 2020 22:04:56 +0800 (CST) X-RM-TRANSID: 2ee75e97148659f-b8795 From: Tang Bin To: wsa@the-dreams.de, o.rempel@pengutronix.de, u.kleine-koenig@pengutronix.de, ardb@kernel.org Subject: [PATCH] i2c: drivers: Avoid unnecessary check in efm32_i2c_probe() Date: Wed, 15 Apr 2020 22:06:40 +0800 Message-Id: <20200415140640.19948-1-tangbin@cmss.chinamobile.com> X-Mailer: git-send-email 2.20.1.windows.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200415_070542_057977_77996E2E X-CRM114-Status: UNSURE ( 5.89 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.4 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [221.176.66.80 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 SPF_NONE SPF: sender does not publish an SPF Record X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Shengju Zhang , Tang Bin , linux-i2c@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The function efm32_i2c_probe() is only called with an openfirmware platform device.Therefore there is no need to check that it has an openfirmware node. Signed-off-by: Tang Bin Signed-off-by: Shengju Zhang --- drivers/i2c/busses/i2c-efm32.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/i2c/busses/i2c-efm32.c b/drivers/i2c/busses/i2c-efm32.c index 4de31fae7..4786ef6b2 100644 --- a/drivers/i2c/busses/i2c-efm32.c +++ b/drivers/i2c/busses/i2c-efm32.c @@ -312,9 +312,6 @@ static int efm32_i2c_probe(struct platform_device *pdev) int ret; u32 clkdiv; - if (!np) - return -EINVAL; - ddata = devm_kzalloc(&pdev->dev, sizeof(*ddata), GFP_KERNEL); if (!ddata) return -ENOMEM;