Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755324AbaGPJvV (ORCPT ); Wed, 16 Jul 2014 05:51:21 -0400 Received: from mail-pd0-f176.google.com ([209.85.192.176]:53680 "EHLO mail-pd0-f176.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750717AbaGPJvS (ORCPT ); Wed, 16 Jul 2014 05:51:18 -0400 Message-ID: <53C64AC8.3000709@gmail.com> Date: Wed, 16 Jul 2014 15:20:00 +0530 From: Varka Bhadram Organization: CDAC-HYD User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.6.0 MIME-Version: 1.0 To: =?ISO-8859-1?Q?Antoine_T=E9nart?= CC: sebastian.hesselbarth@gmail.com, Peter.Chen@freescale.com, balbi@ti.com, p.zabel@pengutronix.de, alexandre.belloni@free-electrons.com, thomas.petazzoni@free-electrons.com, zmxu@marvell.com, jszhang@marvell.com, linux-arm-kernel@lists.infradead.org, linux-usb@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 05/12] phy: add the Berlin USB PHY driver References: <1405499166-6726-1-git-send-email-antoine.tenart@free-electrons.com> <1405499166-6726-6-git-send-email-antoine.tenart@free-electrons.com> <53C64389.3050705@gmail.com> <20140716092541.GC28151@kwain> <53C646DA.3020002@gmail.com> <20140716094747.GD28151@kwain> In-Reply-To: <20140716094747.GD28151@kwain> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 07/16/2014 03:17 PM, Antoine T?nart wrote: > On Wed, Jul 16, 2014 at 03:03:14PM +0530, Varka Bhadram wrote: >> On 07/16/2014 02:55 PM, Antoine T?nart wrote: >>> Hi Varka, >>> >>> On Wed, Jul 16, 2014 at 02:49:05PM +0530, Varka Bhadram wrote: >>>> On 07/16/2014 01:55 PM, Antoine T?nart wrote: >>>>> +static const struct of_device_id phy_berlin_sata_of_match[] = { >>>>> + { >>>>> + .compatible = "marvell,berlin2-usb-phy", >>>>> + .data = &phy_berlin_pll_dividers[0], >>>>> + }, >>>>> + { >>>>> + .compatible = "marvell,berlin2cd-usb-phy", >>>>> + .data = &phy_berlin_pll_dividers[1], >>>>> + }, >>>>> + { }, >>>>> +}; >>>>> +MODULE_DEVICE_TABLE(of, phy_berlin_sata_of_match); >>>>> + >>>> It looks good if we move this after probe().. So that we can see of_match_table directly... >>> We use the of match table in the probe, when calling of_match_device(). >>> >>>>> +static int phy_berlin_usb_probe(struct platform_device *pdev) >>>>> +{ >>>>> + const struct of_device_id *match = >>>>> + of_match_device(phy_berlin_sata_of_match, &pdev->dev); >> We are updating of_match_table in platform_driver struct. > Yes. This is not the same thing. of_match_device() allows to get a > pointer to the of_device_id that matched, to retrieve its data. > >> Every driver follows the concept of giving the of_device_ids >> above the platform_driver declaration... > Lots of drivers using of_match_device() declare their of_device_id > structure before the probe. > Yes . I also checked that. Thanks :-) -- Regards, Varka Bhadram. -- 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/