File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,13 +39,12 @@ static struct macio_chip *macio_on_hold;
3939
4040static int macio_bus_match (struct device * dev , struct device_driver * drv )
4141{
42- struct macio_dev * macio_dev = to_macio_device (dev );
4342 const struct of_device_id * matches = drv -> of_match_table ;
4443
4544 if (!matches )
4645 return 0 ;
4746
48- return of_match_device (matches , & macio_dev -> ofdev ) != NULL ;
47+ return of_match_device (matches , dev ) != NULL ;
4948}
5049
5150struct macio_dev * macio_dev_get (struct macio_dev * dev )
@@ -83,7 +82,7 @@ static int macio_device_probe(struct device *dev)
8382
8483 macio_dev_get (macio_dev );
8584
86- match = of_match_device (drv -> driver .of_match_table , & macio_dev -> ofdev );
85+ match = of_match_device (drv -> driver .of_match_table , dev );
8786 if (match )
8887 error = drv -> probe (macio_dev , match );
8988 if (error )
Original file line number Diff line number Diff line change 1010#include <asm/errno.h>
1111
1212/**
13- * of_match_device - Tell if an of_device structure has a matching
14- * of_match structure
13+ * of_match_device - Tell if a struct device matches an of_device_id list
1514 * @ids: array of of device match structures to search in
1615 * @dev: the of device structure to match against
1716 *
1817 * Used by a driver to check whether an of_device present in the
1918 * system is in its list of supported devices.
2019 */
2120const struct of_device_id * of_match_device (const struct of_device_id * matches ,
22- const struct of_device * dev )
21+ const struct device * dev )
2322{
24- if (!dev -> dev . of_node )
23+ if (!dev -> of_node )
2524 return NULL ;
26- return of_match_node (matches , dev -> dev . of_node );
25+ return of_match_node (matches , dev -> of_node );
2726}
2827EXPORT_SYMBOL (of_match_device );
2928
Original file line number Diff line number Diff line change @@ -21,13 +21,12 @@ extern struct device_attribute of_platform_device_attrs[];
2121
2222static int of_platform_bus_match (struct device * dev , struct device_driver * drv )
2323{
24- struct of_device * of_dev = to_of_device (dev );
2524 const struct of_device_id * matches = drv -> of_match_table ;
2625
2726 if (!matches )
2827 return 0 ;
2928
30- return of_match_device (matches , of_dev ) != NULL ;
29+ return of_match_device (matches , dev ) != NULL ;
3130}
3231
3332static int of_platform_device_probe (struct device * dev )
@@ -45,7 +44,7 @@ static int of_platform_device_probe(struct device *dev)
4544
4645 of_dev_get (of_dev );
4746
48- match = of_match_device (drv -> driver .of_match_table , of_dev );
47+ match = of_match_device (drv -> driver .of_match_table , dev );
4948 if (match )
5049 error = drv -> probe (of_dev , match );
5150 if (error )
Original file line number Diff line number Diff line change 1111#define to_of_device (d ) container_of(d, struct of_device, dev)
1212
1313extern const struct of_device_id * of_match_device (
14- const struct of_device_id * matches , const struct of_device * dev );
14+ const struct of_device_id * matches , const struct device * dev );
1515
1616extern struct of_device * of_dev_get (struct of_device * dev );
1717extern void of_dev_put (struct of_device * dev );
You can’t perform that action at this time.
0 commit comments