Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3265224pxb; Mon, 16 Nov 2020 09:50:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJzG8X9mbdWW9maCrM4MOFz0dWw/MyA5+SOnmFdqkVOX/SmSZjZC8X8Oj8JYfTbADi0hTMK4 X-Received: by 2002:a50:fd06:: with SMTP id i6mr17463751eds.318.1605549054477; Mon, 16 Nov 2020 09:50:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605549054; cv=none; d=google.com; s=arc-20160816; b=pO/dRIMQjRga7jmaphTahQj6cBy9iEJXsrA3ud+xmWA9Vj2NtsMqTIS8ygW9891+H7 eHLM1oCZgeXs+TDiuVcLnQoGejk+4rFOJJl9UBrjttpgSA9uCEQAOEuJh5CMwvO5FMoG xpIX54BeZGpOS8UZohr2Kwj2H/DQxyN5ejG6chiF0BFfMFMgZ0b/pHDeOguWp0wGNUAf Henx49kzPCD8DJAxCkO8Eo00tE8L3QsfceNccCgCLJlMkLwFJbQR5SgxM4LSXLvAwG2U GTsBeJypxfE0/rJX3VmAyRDFRy0+vHf9kW+tj9Om6TeivFQgQ5PgoF1M2A7QVppwl5+m U6cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=t4fCiEe+xmkdug920E8/fJTace7oVmKN/w3nLRJO5j4=; b=F5DwCv6UkClszSpfihQCz5DtpSXvqR4F7EvwZrQn/jKzsP4pL/LDJxtQZ8wFkg7JrE 1e5ytOMvOzFLA1u/cDiHHV5oK4Mbdc0UQt7fzz3ypqlmNYPvBqg2VUmpisj+KqpDwYew Ccc5It+KIFzk6wVc0R8ou2BbKkwj1H+CSPR2+Dv9Gkyhl/kXCuHfkZzfQT9rByuTTgCp doWQc5JLGp8PGm5AAv5LPairaHS7Hdm8alLZcL+XnhaWuiVXsjWGkZY11Yx02vyMSDn0 su6d1styUX1PpOX29UpFsXRL7wfqigUPvVj5b3mL0S5I7jCI0jN//k8RYCkg/qA5WxYr h2xA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="N5Cp/cvZ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b10si11581100ejv.433.2020.11.16.09.50.30; Mon, 16 Nov 2020 09:50:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="N5Cp/cvZ"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387857AbgKPRpk (ORCPT + 99 others); Mon, 16 Nov 2020 12:45:40 -0500 Received: from mail.kernel.org ([198.145.29.99]:56100 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731712AbgKPRpj (ORCPT ); Mon, 16 Nov 2020 12:45:39 -0500 Received: from kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com (unknown [163.114.132.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 10D6B20B80; Mon, 16 Nov 2020 17:45:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1605548739; bh=tQW67WaRqbqEetQTxYCnJ/yXmPFnNQVNmYTNVKmKS+Q=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=N5Cp/cvZZupZ8JgSE3HETbGgmW35MK+6KDFsi3a2eckV5fEql5j7G55cdbs6hzqIV RQ7XfIH+ki7GHSSCfruj9XO72u0UKzv6B7Qn6RgHW4uZOhpu5AMLWTEJC/4ScJsjcu y0dIL0aaJr9kfIbMDF4DNMJ6hXjwmWeezW+mXEtU= Date: Mon, 16 Nov 2020 09:45:38 -0800 From: Jakub Kicinski To: Marco Felsch Cc: Florian Fainelli , Zhang Changzhong , andrew@lunn.ch, hkallweit1@gmail.com, linux@armlinux.org.uk, davem@davemloft.net, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net] net: phy: smsc: add missed clk_disable_unprepare in smsc_phy_probe() Message-ID: <20201116094538.47937d15@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <20201116092607.psaelzuga3kcrryu@pengutronix.de> References: <1605180239-1792-1-git-send-email-zhangchangzhong@huawei.com> <20201114112625.440b52f2@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> <20201116092607.psaelzuga3kcrryu@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 16 Nov 2020 10:26:07 +0100 Marco Felsch wrote: > > > The code right above looks highly questionable as well: > > > > > > priv->refclk = clk_get_optional(dev, NULL); > > > if (IS_ERR(priv->refclk)) > > > dev_err_probe(dev, PTR_ERR(priv->refclk), "Failed to request clock\n"); > > > > > > ret = clk_prepare_enable(priv->refclk); > > > if (ret) > > > return ret; > > > > > > I don't think clk_prepare_enable() will be too happy to see an error > > > pointer. This should probably be: > > > > > > priv->refclk = clk_get_optional(dev, NULL); > > > if (IS_ERR(priv->refclk)) > > > return dev_err_probe(dev, PTR_ERR(priv->refclk), > > > "Failed to request clock\n"); > > > > Right, especially if EPROBE_DEFER must be returned because the clock > > provider is not ready yet, we should have a chance to do that. > > damn.. I missed the return here. Thanks for covering that. Should I send > a fix or did you do that already? Please do, I don't see any fix for this issue in patchwork right now.