From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org 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 smtp.lore.kernel.org (Postfix) with ESMTPS id 46F14C54EE9 for ; Tue, 13 Sep 2022 07:47:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ad/fAca1J85Phj+UH4kQcPvw3pDIcDyvsuIekuKucMc=; b=a8khAJxmMqcLFt w3ZbZ7CXOag+2u7vIYaK+YLX8MOBYFdEy/3DHq+L3FpwyHIZ9FSn+vJM8Gmj9jV6NtGr2J4nT8z36 pY+VRbc4I1dW7YiVr9Sg6U4laJOYVRbK74iyOdSvkmKoBYttV5TbHNbknEPAbPHVoMJfRcgmrI3/u byX5EXU+75iOA/sViy01fi2agkbmXkLfX4PI253ZD9eh1/4jIamhem+enmt0v8oAZaWPrgQee6yvs I5OM8r0r21cW0Tq2tnjz+988rauleiUJJOREJLEAO4lqZ/mWcBVDdYGi6xJWAs/u4ekGfVHCtEacM 7Y0hJHKVTn/CvwKp1uGw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oY0cv-003kNa-F5; Tue, 13 Sep 2022 07:46:37 +0000 Received: from pandora.armlinux.org.uk ([2001:4d48:ad52:32c8:5054:ff:fe00:142]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oY0ce-003kGR-7T for linux-arm-kernel@lists.infradead.org; Tue, 13 Sep 2022 07:46:29 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=7R46dL5v/qAAceuZ423ZSM42+lTG5q+jzS8a0ZHd/yA=; b=G4HJswNfkvqvbqgOKeKi5WXj8O JuEpK1sh7BVrm90ZMiDMwiCB3P2tVsIpxr0G2uo2fEOIkWmF+gBR61FBIk9kMY/nhTgANroSLAZsK vwmMWfq1z1Wvd3Q//G3gSYr0U6Cm7ri+g/6VvKjJZCK8fI9g4+KSMZaet8hsr9/e7omVcehR5HIIk OmUBpkhdCurtJjVThQDsEWjdLMnU9GZGEq7OyHdvC/8epR6czzdq5OAvYuMjD0TCJ81jIjEEOGMz+ YR4zt9V9DqxzeNwaIRLgIM/Iz6PObghcRWAxaXUqPYFBjGdNgZKgmQnLpuK8NexrTkw4AjL8whuZu HnN+b4mw==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:34286) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1oY0cS-0002aM-4j; Tue, 13 Sep 2022 08:46:08 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1oY0cQ-0000Vo-RI; Tue, 13 Sep 2022 08:46:06 +0100 Date: Tue, 13 Sep 2022 08:46:06 +0100 From: "Russell King (Oracle)" To: Lucas Stach Cc: Tang Bin , hongxing.zhu@nxp.com, lorenzo.pieralisi@arm.com, robh@kernel.org, kw@linux.com, shawnguo@kernel.org, bhelgaas@google.com, s.hauer@pengutronix.de, kernel@pengutronix.de, festevam@gmail.com, linux-imx@nxp.com, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] PCI: imx6: Fix wrong check in imx6_pcie_attach_pd() Message-ID: References: <20220913065910.15348-1-tangbin@cmss.chinamobile.com> <0660fff6d29c5f8251ac4f28d4badcfea91e6833.camel@pengutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <0660fff6d29c5f8251ac4f28d4badcfea91e6833.camel@pengutronix.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220913_004628_372509_D25E71A7 X-CRM114-Status: GOOD ( 13.37 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Tue, Sep 13, 2022 at 09:39:03AM +0200, Lucas Stach wrote: > Am Dienstag, dem 13.09.2022 um 14:59 +0800 schrieb Tang Bin: > > In the function imx6_pcie_attach_pd(), > > dev_pm_domain_attach_by_name() may return NULL in some cases, > > so IS_ERR() doesn't meet the requirements. Thus fix it. > > > I don't like this added complexity in the driver. IHMO if there is a > real issue, dev_pm_domain_attach_by_name() should just return a error > code, instead of NULL. You've fallen into the trap that Tang Bin laid. It returns an error code for all cases where an error has happened. It returns NULL only when the device does not require a power domain. So, a NULL return is *not* an error condition, but merely an indication that "this device does not require this power domain". Mechanical changes like this are really quite harmful to the kernel. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 40Mbps down 10Mbps up. Decent connectivity at last! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel