From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 67AFCA4E for ; Wed, 23 Aug 2023 14:37:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 416A2C433C8; Wed, 23 Aug 2023 14:37:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692801464; bh=nFJQaMzN4+WOLIo2ulDo6fG5gqWoQo4wo3RYzpQckXc=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=gxOf27+jWp737fuS7z8Smvhvl7GaSIrp09nUEqpoI18ihVEJs7YH2wukNxniJICIX IKtHxdngK5gi8uVYA1JFKq3/Diis4fChN2cizYXXSSKNjag9UWSbNXpuJmGPwYxNNa 8SMuXEcs7gp39l4ed5PoNzETHL8UNlmY7mYb6vWu/g57L9TYmTuYtQqtTSh4Ve3a1d RTb+9ttsUAWlYqf2zj6EEfY56xh44BJB0GziyURSx879VjFqR5MbECpCtd6eNa5tFy ndVk5MYvnvJMHPD2jMAm4U6WkFQys1qQPhWo3Q+c7Kh/8whDYb9sUkcjWueixgc1Z3 whpEeZarTXf+g== Date: Wed, 23 Aug 2023 07:37:43 -0700 From: Jakub Kicinski To: Ruan Jinjie Cc: , , , , , , , , , , Subject: Re: [PATCH net-next v4 3/3] net: lan743x: Return PTR_ERR() for fixed_phy_register() Message-ID: <20230823073743.61770fa4@kernel.org> In-Reply-To: <2763f37a-8707-7fad-5dd4-cc4247fe3e1b@huawei.com> References: <20230821025020.1971520-1-ruanjinjie@huawei.com> <20230821025020.1971520-4-ruanjinjie@huawei.com> <20230822170335.671f3bef@kernel.org> <2763f37a-8707-7fad-5dd4-cc4247fe3e1b@huawei.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 23 Aug 2023 15:43:58 +0800 Ruan Jinjie wrote: > > EPROBE_DEFER is not a unix error code. We can't return it to user > > space, so propagating it from ndo_open is not correct. > > When the error is EPROBE_DEFER, Whether print the netdev_err is ok? And > what should it return? > > How about this? > > if (IS_ERR(phydev)) { > ...... > if (PTR_ERR(phydev) != -EPROBE_DEFER) > return PTR_ERR(phydev); > else > return -EIO; > } That's too much code to copy & paste into every driver. Someone who understands the code flow very well should tackle this. Please leave the cases where fixed_phy_register() is called outside of probe alone.