From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932234AbcKGO5F (ORCPT ); Mon, 7 Nov 2016 09:57:05 -0500 Received: from pandora.armlinux.org.uk ([78.32.30.218]:56738 "EHLO pandora.armlinux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752851AbcKGO5B (ORCPT ); Mon, 7 Nov 2016 09:57:01 -0500 Date: Mon, 7 Nov 2016 14:56:28 +0000 From: Russell King - ARM Linux To: Kuninori Morimoto Cc: Archit Taneja , Mark Brown , David Airlie , Fabio Estevam , Daniel Vetter , Koji Matsuoka , Thierry Reding , Linux-ALSA , Liam Girdwood , Simon , linux-renesas-soc@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, Jose Abreu Subject: Re: [PATCH v3] drm: bridge: add DesignWare HDMI I2S audio support Message-ID: <20161107145627.GG1041@n2100.armlinux.org.uk> References: <871syu4r3x.wl%kuninori.morimoto.gx@renesas.com> <20161102082758.GV1041@n2100.armlinux.org.uk> <87twbk9cg8.wl%kuninori.morimoto.gx@renesas.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87twbk9cg8.wl%kuninori.morimoto.gx@renesas.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Nov 07, 2016 at 03:50:00AM +0000, Kuninori Morimoto wrote: > > Hi Russell > > > > + platform = platform_device_register_full(&pdevinfo); > > > + if (IS_ERR_OR_NULL(platform)) > > > + return PTR_ERR(platform); > > > > This is wrong. If platform is NULL, PTR_ERR() will return zero, which > > will be interpreted as success. Please, avoid using IS_ERR_OR_NULL(), > > it leads to exactly this kind of cockup - and it's unnecessary here > > because platform_device_register_full() does not return NULL. > > Thank you for your feedback. > Before sending v4 patch, I would like to confirm. Do you meand this ? > # use IS_ERR() instead of IS_ERR_OR_NULL() > > platform = platform_device_register_full(&pdevinfo); > if (IS_ERR(platform)) > return PTR_ERR(platform); Yes, that's exactly correct. -- RMK's Patch system: http://www.armlinux.org.uk/developer/patches/ FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up according to speedtest.net.