Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp752222pxb; Fri, 22 Apr 2022 10:23:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx+WU0zXQ2i5BzWgmiCIiy3rIwyHvPR9cra4WfNGVa94+UuzhvjPmkjBEHYaaAHXOXzrytW X-Received: by 2002:a17:90b:4f44:b0:1d2:c5f4:1a8d with SMTP id pj4-20020a17090b4f4400b001d2c5f41a8dmr6604774pjb.4.1650648207111; Fri, 22 Apr 2022 10:23:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650648207; cv=none; d=google.com; s=arc-20160816; b=CcdisOjaqBM0iMfA33tgqLf0MTWm197nrGK4R+em95BL6NvBsBRhhhB42viXQYjLfs gLXL5b8FkGWUsaqov/YbdpQdIWTJ9ZziZiuFkg+GjHVwHEMHzj3nnuZO2OeA2RE2274t NyHTZ3gHZmlhh1e6DhE+k3hwQ1pMskCG/45SsBRS91fycT3os8aO13Fln+DFdBjunM5c PD18FncRIzoFc62RaNYkZyMOpBUh9r/sUi5emtJjZbrkg/TakpdsIgOmZeTqK/lgWN3Q Ii6ZJlZHYCEUfMB++DWtCzHnp5dr4FeXe/LmDOOKgC5tSfdu/x5hVO8ncXCvk+ARVuOy IfaQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=RP65Uj7WP6EZyZBfeufvI+9bp/deJnrcdnu1tws0K2A=; b=NqNHS5bJMtfnqwXE3U3xaDadS4E1ZPtI237Rbj+dSU6IENNG0l0FMfbHrZmnsMjjyg 2fCJC0q9qsexU8Mm/0FXozVNRZ3QdeiL22sUlR6fPRlDJEcs5Xm2ydVdOPA+2p6IJm+d hXT+rvo+MApw5tQfWXHlD0geKOdn1WQV6fg01GrdOjEL+RJjoiTJ8Lzp5/F54NcjLXdQ 94KdYmDv93aF4GJPin02NQxPgN0lWvk7CDznoNkWiNepQe+pO4MSew9XyEgsxzEy9ger PbKwUpz/xv7zMJc0lqafzArDXq8GBXz4XhKIHrI46sV7ji68hIruFYH5ZZQCe5tjwZON 6/Ng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Sh+RI4qz; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id cw28-20020a056a00451c00b00509fc34d6c4si7491188pfb.173.2022.04.22.10.23.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 10:23:27 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Sh+RI4qz; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id D1C53B0D34; Fri, 22 Apr 2022 10:17:21 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1449866AbiDVQyI (ORCPT + 99 others); Fri, 22 Apr 2022 12:54:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1444743AbiDVQyD (ORCPT ); Fri, 22 Apr 2022 12:54:03 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6E3755F276 for ; Fri, 22 Apr 2022 09:51:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650646267; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RP65Uj7WP6EZyZBfeufvI+9bp/deJnrcdnu1tws0K2A=; b=Sh+RI4qzipwvz36dpAQno5dGL6bHP5Q/1mVC/ZfMmAmGmFFbVM+TwpMa6S3KHgapEzTWt/ U5hnDs1CJWiJn/34X0jmA+GDFugOUrqST+39vRBnlAVea3TvdvXPN+buD8jdfEuqvCyGG2 mil2XxTZQ6Fak5AS5fxOFkF6vWJSHuo= Received: from mail-qt1-f200.google.com (mail-qt1-f200.google.com [209.85.160.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-639-VIR_kJDlMziqi_bD4qr2Lg-1; Fri, 22 Apr 2022 12:51:06 -0400 X-MC-Unique: VIR_kJDlMziqi_bD4qr2Lg-1 Received: by mail-qt1-f200.google.com with SMTP id r16-20020ac87950000000b002f34f162c75so3067048qtt.9 for ; Fri, 22 Apr 2022 09:51:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=RP65Uj7WP6EZyZBfeufvI+9bp/deJnrcdnu1tws0K2A=; b=UfuyrPRWxePWrShY1Ax3UJdMaL6BOiGZkk222PQQv7Mtb0T6VtCu0hIeQLd1BIHEsv dAdrlZTB3HpbqadObBLiV6kVnhkYK3MEVe4uFMxWBKF31i0jzwAp43ZUUL/oAwNRyjIJ WTGbUPdOJZLL21laizsu9Re6mQD+s7hy3rrkfckHuNZEq9YzYyIhLUXhu+xCVpyJsvxQ 8vDVcdJ9u2FqkyZ0vO92D9zSAPQOHZx/+DzDPX78rdttUK8ut0JQWCe4YIBHMm9SQjoe uXH9Jb4ol7H5yaihUeIDfjOVqdStbPD7RHsRhbas80UAHttaR2dXdtgSrVatGsbz+Ba2 CS3A== X-Gm-Message-State: AOAM531gK04+RprRIyYhlaHWAsXSr6hDCOQSYPoDPeKNL8nxF2RZO9Rs qdE8BlXwcz3lAwgz98Nz/cAJIHKGsPwx5GaT0hVqXA56bGWiYyheUlvld3iE2qb7ceX5sNCEnJ5 GcbzeTePXzp85aYNjUoI3jtnX X-Received: by 2002:a37:6181:0:b0:69e:7b8a:e72c with SMTP id v123-20020a376181000000b0069e7b8ae72cmr3255238qkb.388.1650646265968; Fri, 22 Apr 2022 09:51:05 -0700 (PDT) X-Received: by 2002:a37:6181:0:b0:69e:7b8a:e72c with SMTP id v123-20020a376181000000b0069e7b8ae72cmr3255217qkb.388.1650646265599; Fri, 22 Apr 2022 09:51:05 -0700 (PDT) Received: from halaneylaptop (068-184-200-203.res.spectrum.com. [68.184.200.203]) by smtp.gmail.com with ESMTPSA id e16-20020ac85990000000b002f33eb4523asm1542421qte.18.2022.04.22.09.51.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Apr 2022 09:51:04 -0700 (PDT) Date: Fri, 22 Apr 2022 11:51:01 -0500 From: Andrew Halaney To: Manivannan Sadhasivam Cc: martin.petersen@oracle.com, jejb@linux.ibm.com, avri.altman@wdc.com, alim.akhtar@samsung.com, bjorn.andersson@linaro.org, linux-arm-msm@vger.kernel.org, quic_asutoshd@quicinc.com, quic_cang@quicinc.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/5] scsi: ufs: qcom: Simplify handling of devm_phy_get() Message-ID: <20220422165101.uy23jf3conuxr2iw@halaneylaptop> References: <20220422132140.313390-1-manivannan.sadhasivam@linaro.org> <20220422132140.313390-3-manivannan.sadhasivam@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220422132140.313390-3-manivannan.sadhasivam@linaro.org> X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Apr 22, 2022 at 06:51:37PM +0530, Manivannan Sadhasivam wrote: > There is no need to call devm_phy_get() if ACPI is used, so skip it. > The "host->generic_phy" pointer should already be NULL due to the kzalloc, > so no need to set it NULL again. > > Also, don't print the error message in case of -EPROBE_DEFER and return > the error code directly. > > While at it, also remove the comment that has no relationship with > devm_phy_get(). > > Signed-off-by: Manivannan Sadhasivam > --- > drivers/scsi/ufs/ufs-qcom.c | 26 +++++--------------------- > 1 file changed, 5 insertions(+), 21 deletions(-) > > diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c > index 5db0fd922062..5f0a8f646eb5 100644 > --- a/drivers/scsi/ufs/ufs-qcom.c > +++ b/drivers/scsi/ufs/ufs-qcom.c > @@ -1022,28 +1022,12 @@ static int ufs_qcom_init(struct ufs_hba *hba) > err = 0; > } > > - /* > - * voting/devoting device ref_clk source is time consuming hence > - * skip devoting it during aggressive clock gating. This clock > - * will still be gated off during runtime suspend. > - */ > - host->generic_phy = devm_phy_get(dev, "ufsphy"); > - > - if (host->generic_phy == ERR_PTR(-EPROBE_DEFER)) { > - /* > - * UFS driver might be probed before the phy driver does. > - * In that case we would like to return EPROBE_DEFER code. > - */ > - err = -EPROBE_DEFER; > - dev_warn(dev, "%s: required phy device. hasn't probed yet. err = %d\n", > - __func__, err); > - goto out_variant_clear; > - } else if (IS_ERR(host->generic_phy)) { > - if (has_acpi_companion(dev)) { > - host->generic_phy = NULL; > - } else { > + if (!has_acpi_companion(dev)) { > + host->generic_phy = devm_phy_get(dev, "ufsphy"); > + if (IS_ERR(host->generic_phy)) { > err = PTR_ERR(host->generic_phy); > - dev_err(dev, "%s: PHY get failed %d\n", __func__, err); > + if (err != -EPROBE_DEFER) > + dev_err(dev, "Failed to get PHY: %d\n", err); Risking sounding like a bad broken record, but I think this too could use dev_err_probe(). Looks good to me otherwise! > goto out_variant_clear; > } > } > -- > 2.25.1 >