From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Return-Path: Message-ID: Subject: Re: [PATCH v2 2/2] PCI: meson: add the Amlogic Meson PCIe phy driver From: Jerome Brunet To: Hanjie Lin , Kishon Vijay Abraham I Date: Wed, 29 Aug 2018 17:57:43 +0200 In-Reply-To: <1535096006-152091-3-git-send-email-hanjie.lin@amlogic.com> References: <1535096006-152091-1-git-send-email-hanjie.lin@amlogic.com> <1535096006-152091-3-git-send-email-hanjie.lin@amlogic.com> Mime-Version: 1.0 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Rob Herring , Jianxin Pan , linux-pci@vger.kernel.org, Yixun Lan , Yue Wang , Qiufang Dai , Jian Hu , Kevin Hilman , Carlo Caione , linux-amlogic@lists.infradead.org, Liang Yang , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+bjorn=helgaas.com@lists.infradead.org List-ID: On Fri, 2018-08-24 at 15:33 +0800, Hanjie Lin wrote: > +static int meson_pcie_phy_probe(struct platform_device *pdev) > +{ > + struct device *dev = &pdev->dev; > + struct meson_pcie_phy *mphy; > + struct meson_pcie_reset *mrst; > + struct phy *generic_phy; > + struct phy_provider *phy_provider; > + struct resource *res; > + const struct meson_pcie_phy_data *data; > + > + data = of_device_get_match_data(dev); > + if (!data) > + return -ENODEV; > + > + mphy = devm_kzalloc(dev, sizeof(*mphy), GFP_KERNEL); > + if (!mphy) > + return -ENOMEM; > + res = platform_get_resource(pdev, IORESOURCE_MEM, 0); > + mphy->phy_base = devm_ioremap_resource(dev, res); > + if (IS_ERR(mphy->phy_base)) > + return PTR_ERR(mphy->phy_base); > + > + mrst = &mphy->reset; > + > + mrst->phy = devm_reset_control_get_shared(dev, "phy"); I thought you said there was only phy on this platform. If that's the case, what is this reset shared with ? > + if (IS_ERR(mrst->phy)) { > + if (PTR_ERR(mrst->phy) != -EPROBE_DEFER) > + dev_err(dev, "couldn't get phy reset\n"); > + > + return PTR_ERR(mrst->phy); > + } > + > + reset_control_deassert(mrst->phy); Is it really necessary before init() is called by the consumer ? > + > + mphy->data = data; > + > + generic_phy = devm_phy_create(dev, dev->of_node, mphy->data->ops); > + if (IS_ERR(generic_phy)) { > + if (PTR_ERR(generic_phy) != -EPROBE_DEFER) > + dev_err(dev, "failed to create PHY\n"); > + > + return PTR_ERR(generic_phy); > + } > + > + phy_set_drvdata(generic_phy, mphy); > + phy_provider = devm_of_phy_provider_register(dev, of_phy_simple_xlate); > + > + return PTR_ERR_OR_ZERO(phy_provider); > +} > + > +static struct platform_driver meson_pcie_phy_driver = { > + .probe = meson_pcie_phy_probe, > + .driver = { > + .of_match_table = meson_pcie_phy_match, > + .name = "meson-pcie-phy", > + } > +}; _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel