On Wed, Jul 16, 2014 at 03:03:14PM +0530, Varka Bhadram wrote:Yes . I also checked that. Thanks :-)
On 07/16/2014 02:55 PM, Antoine Ténart wrote:Yes. This is not the same thing. of_match_device() allows to get a
Hi Varka,We are updating of_match_table in platform_driver struct.
On Wed, Jul 16, 2014 at 02:49:05PM +0530, Varka Bhadram wrote:
On 07/16/2014 01:55 PM, Antoine Ténart wrote:We use the of match table in the probe, when calling of_match_device().
+static const struct of_device_id phy_berlin_sata_of_match[] = {It looks good if we move this after probe().. So that we can see of_match_table directly...
+ {
+ .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);
+
+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);
pointer to the of_device_id that matched, to retrieve its data.
Every driver follows the concept of giving the of_device_idsLots of drivers using of_match_device() declare their of_device_id
above the platform_driver declaration...
structure before the probe.