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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 865CDC433F5 for ; Thu, 4 Nov 2021 21:48:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5EC076124D for ; Thu, 4 Nov 2021 21:48:03 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231981AbhKDVul (ORCPT ); Thu, 4 Nov 2021 17:50:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:55244 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231950AbhKDVuk (ORCPT ); Thu, 4 Nov 2021 17:50:40 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B627F60F45; Thu, 4 Nov 2021 21:48:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1636062482; bh=XUWkBUYQH1sVQ6/UxiW1zJVuZf29aMTBuB8+gR8Mgco=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=qLZa9FaCjMfC5DSo1Cq5o12BkRNaLMha2tFsgq9zmB17Q2y9SkQwJpvuLBzsG9W9b Snv69wAgNvlrxuacq5H/XmPoICBJ0R7qemZdolOBZQLPyvc3ciL64JGPIoH3c4wZp0 A1xWwvHeLbaTBnINUbGUktuCUPVMcXt/dZ4BawX073QixG/l507+vYgdBOx6Hw6rh8 LDOt+46C6qf05s33LD18qibSUqqll10yUFy0OOKe4m1dhz7odkqYIiY3IXQdldoyf5 Oc6wsb/GqQGbPKH+OJUbKI215ceDRdcBwc0o+Q3W4PQmYYpzgVZjIBBc26/JwxgBiC wWBpnBjvoWmLg== Date: Thu, 4 Nov 2021 16:48:00 -0500 From: Bjorn Helgaas To: Mauro Carvalho Chehab Cc: Lorenzo Pieralisi , linuxarm@huawei.com, mauro.chehab@huawei.com, Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Binghui Wang , Bjorn Helgaas , Rob Herring , Xiaowei Song , linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, Kishon Vijay Abraham I Subject: Re: [PATCH v15 01/13] PCI: kirin: Reorganize the PHY logic inside the driver Message-ID: <20211104214800.GA814298@bhelgaas> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org On Thu, Oct 21, 2021 at 11:45:08AM +0100, Mauro Carvalho Chehab wrote: > The pcie-kirin PCIe driver contains internally a PHY interface for > Kirin 960. > > As the next patches will add support for using an external PHY > driver, reorganize the driver in a way that the PHY part > will be self-contained. > > This could be moved to a separate PHY driver, but a change > like that would mean a non-backward-compatible DT schema > change. > > Cc: Kishon Vijay Abraham I > Acked-by: Xiaowei Song > Signed-off-by: Mauro Carvalho Chehab > +static int hi3660_pcie_phy_init(struct platform_device *pdev, > + struct kirin_pcie *pcie) > +{ > + struct device *dev = &pdev->dev; > + struct hi3660_pcie_phy *phy; > + int ret; > + > + phy = devm_kzalloc(dev, sizeof(*phy), GFP_KERNEL); > + if (!phy) > + return -ENOMEM; > + > + pcie->phy_priv = phy; > + phy->dev = dev; > + > + /* registers */ > + pdev = container_of(dev, struct platform_device, dev); Is there something missing here? "pdev" isn't referenced below. Noticed by Krzysztof. > + ret = hi3660_pcie_phy_get_clk(phy); > + if (ret) > + return ret; > + > + return hi3660_pcie_phy_get_resource(phy); > +}