Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp1369619ybp; Fri, 4 Oct 2019 13:45:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqzVOsVm+WPtqE58CedjEcQyZZkivDaFJY1oMphhzYceNccKi1zXbbL+yokUGdTajN5ovZHr X-Received: by 2002:a17:906:ecf6:: with SMTP id qt22mr14125058ejb.212.1570221920361; Fri, 04 Oct 2019 13:45:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570221920; cv=none; d=google.com; s=arc-20160816; b=nXMMKBkxuXA/mwiUj3bcnMHlc7Eps9YVao2rMTgXw1nUr6A6Akon7UTtP6Fbknbhoq ZgZqbPObyQRH27DNu/uj4z+xaxHPeGPWcinqXs2HH4apbhFmqNEz5+kBsfa+YRXNpe6p 7OhSei//6ssVJibQwtEPPBK7bEahEB685uZIxx68wHZ8+tkJJqCaXaYOd74ZiV0QQTOQ /Ia6ocgpmtQr4JTkcLkl8kL8DNVMp3NSQKJga79I5huf1yYIHSRe8P/CWFWfYOY4YcmM gdj9fUmYL7XR6r26qEMMBvKe6JXdphSaKRW5cR+gU4S8rRn/4lNWhjsdyflYkiO1FOHs nyJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=cCdprgihGZtgh9Z2p7g0jdN/JLDnvPP/JzRj0TFUQ6o=; b=LrbPjNcQkA+AJiNimilM5FAJgr87pWdubeW6F2dONTEc5eDadE3MWmNxdpIjv9mwP1 BHAl5hzofplnTFDNxF9cFZn6j22X1JFEJwKIhkkAPkysdkECAWEUpkVY6svHa0Ml+hPB R9NvM2wPcBx2Uduj7zeR1MR0qnXxAlOj6QCqihGXRDzpf5vf634qpDkS0n9eX8xAhKr7 bqf5ftwbMj4x0JF/c1/ccrE2ZCcHWcLIj6c5fjvEJYRFMMbY90FugGf4Fu5vhIOnCm+Q oG6D3dPJo5Q/i1tf0cnyiJzngY94xEi306Ia4Jm2rthvvuRGHdilXIHUhdmC2i8Hhcc7 6lLA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y7si3651641ejp.378.2019.10.04.13.44.57; Fri, 04 Oct 2019 13:45:20 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388272AbfJDUjr (ORCPT + 99 others); Fri, 4 Oct 2019 16:39:47 -0400 Received: from metis.ext.pengutronix.de ([85.220.165.71]:47615 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388107AbfJDUjr (ORCPT ); Fri, 4 Oct 2019 16:39:47 -0400 Received: from pty.hi.pengutronix.de ([2001:67c:670:100:1d::c5]) by metis.ext.pengutronix.de with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1iGUMQ-00047D-Kn; Fri, 04 Oct 2019 22:39:34 +0200 Received: from ukl by pty.hi.pengutronix.de with local (Exim 4.89) (envelope-from ) id 1iGUMP-0000YC-L0; Fri, 04 Oct 2019 22:39:33 +0200 Date: Fri, 4 Oct 2019 22:39:33 +0200 From: Uwe =?iso-8859-1?Q?Kleine-K=F6nig?= To: Claudiu.Beznea@microchip.com Cc: kamel.bouhara@bootlin.com, wsa@the-dreams.de, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Nicolas.Ferre@microchip.com, alexandre.belloni@bootlin.com, Ludovic.Desroches@microchip.com, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, thomas.petazzoni@bootlin.com Subject: Re: [PATCH 2/4] i2c: at91: implement i2c bus recovery Message-ID: <20191004203933.tfhr6cwbsq2hxrov@pengutronix.de> References: <20191002144658.7718-1-kamel.bouhara@bootlin.com> <20191002144658.7718-3-kamel.bouhara@bootlin.com> <08e99a4b-851e-0bee-4c5a-8578b42c283e@microchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <08e99a4b-851e-0bee-4c5a-8578b42c283e@microchip.com> User-Agent: NeoMutt/20170113 (1.7.2) X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::c5 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Oct 04, 2019 at 09:35:23AM +0000, Claudiu.Beznea@microchip.com wrote: > Hi Kamel, > > On 02.10.2019 17:46, Kamel Bouhara wrote: > > +static int at91_init_twi_recovery_info(struct platform_device *pdev, > > + struct at91_twi_dev *dev) > > +{ > > + struct i2c_bus_recovery_info *rinfo = &dev->rinfo; > > + > > + dev->pinctrl = devm_pinctrl_get(&pdev->dev); > > + if (!dev->pinctrl || IS_ERR(dev->pinctrl)) { > > You may use IS_ERR_OR_NULL() here. Can devm_pinctrl_get return NULL? From a quick look, it cannot. rule of thumb: IS_ERR_OR_NULL is wrong as it is a sign of poor return value semantics. Best regards Uwe -- Pengutronix e.K. | Uwe Kleine-K?nig | Industrial Linux Solutions | http://www.pengutronix.de/ |