Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753457AbbFHOwf (ORCPT ); Mon, 8 Jun 2015 10:52:35 -0400 Received: from mail-vn0-f46.google.com ([209.85.216.46]:35694 "EHLO mail-vn0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753416AbbFHOwV (ORCPT ); Mon, 8 Jun 2015 10:52:21 -0400 MIME-Version: 1.0 In-Reply-To: References: <1433324255-27510-1-git-send-email-ygardi@codeaurora.org> <1433324255-27510-5-git-send-email-ygardi@codeaurora.org> From: Rob Herring Date: Mon, 8 Jun 2015 09:51:59 -0500 Message-ID: Subject: Re: [PATCH v2 4/4] scsi: ufs: probe and init of variant driver from the platform device To: Akinobu Mita Cc: Yaniv Gardi , Jej B , LKML , "linux-scsi@vger.kernel.org" , linux-arm-msm , Santosh Y , linux-scsi-owner@vger.kernel.org, Subhash Jadavani , Paul Bolle , Gilad Broner , Rob Herring , Pawel Moll , Mark Rutland , Ian Campbell , Kumar Gala , Vinayak Holikatti , "James E.J. Bottomley" , Dolev Raviv , Christoph Hellwig , Sujit Reddy Thumma , Raviv Shvili , Sahitya Tummala , "open list:OPEN FIRMWARE AND..." Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1767 Lines: 49 On Thu, Jun 4, 2015 at 9:32 AM, Akinobu Mita wrote: > Hi Yaniv, > > 2015-06-03 18:37 GMT+09:00 Yaniv Gardi : >> @@ -321,7 +313,22 @@ static int ufshcd_pltfrm_probe(struct platform_device *pdev) >> goto out; >> } >> >> - hba->vops = get_variant_ops(&pdev->dev); >> + err = of_platform_populate(node, NULL, NULL, &pdev->dev); >> + if (err) >> + dev_err(&pdev->dev, >> + "%s: of_platform_populate() failed\n", __func__); >> + >> + ufs_variant_node = of_get_next_available_child(node, NULL); >> + >> + if (!ufs_variant_node) { >> + dev_dbg(&pdev->dev, "failed to find ufs_variant_node child\n"); >> + } else { >> + ufs_variant_pdev = of_find_device_by_node(ufs_variant_node); >> + >> + if (ufs_variant_pdev) >> + hba->vops = (struct ufs_hba_variant_ops *) >> + dev_get_drvdata(&ufs_variant_pdev->dev); >> + } > > I have no strong objection to 'ufs_variant' sub-node. But why can't we > simply add an of_device_id to ufs_of_match, like below: But I do have objections on both the naming and having a sub-node. > > static const struct of_device_id ufs_of_match[] = { > { .compatible = "jedec,ufs-1.1"}, > #if IS_ENABLED(SCSI_UFS_QCOM) > { .compatible = "qcom,ufs", .data = &ufs_hba_qcom_vops }, Be more specific: qcom,-ufs > #neidf Drop the ifdef. Rob -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/