Message ID | 1295935170-19518-1-git-send-email-thomas@wytron.com.tw |
---|---|
State | Superseded, archived |
Delegated to: | David Miller |
Headers | show |
On Mon, Jan 24, 2011 at 10:59 PM, Thomas Chou <thomas@wytron.com.tw> wrote: > Signed-off-by: Thomas Chou <thomas@wytron.com.tw> > --- > drivers/net/smc91x.c | 10 ++++++++++ > 1 files changed, 10 insertions(+), 0 deletions(-) > > diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c > index 726df61..d29e18d 100644 > --- a/drivers/net/smc91x.c > +++ b/drivers/net/smc91x.c > @@ -81,6 +81,7 @@ static const char version[] = > #include <linux/ethtool.h> > #include <linux/mii.h> > #include <linux/workqueue.h> > +#include <linux/of.h> > > #include <linux/netdevice.h> > #include <linux/etherdevice.h> > @@ -2394,6 +2395,12 @@ static int smc_drv_resume(struct device *dev) > return 0; > } > > +static const struct of_device_id smc91x_match[] = { > + { .compatible = "smsc,smc91x", }, Be specific. What *exact* smsc device are you adding support for? Wildcards like smc91x tend to cause problems in the future. > + {}, > +} > +MODULE_DEVICE_TABLE(of, smc91x_match); > + > static struct dev_pm_ops smc_drv_pm_ops = { > .suspend = smc_drv_suspend, > .resume = smc_drv_resume, > @@ -2406,6 +2413,9 @@ static struct platform_driver smc_driver = { > .name = CARDNAME, > .owner = THIS_MODULE, > .pm = &smc_drv_pm_ops, > +#ifdef CONFIG_OF > + .of_match_table = smc91x_match, > +#endif > }, > }; > > -- > 1.7.3.5 > >
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c index 726df61..d29e18d 100644 --- a/drivers/net/smc91x.c +++ b/drivers/net/smc91x.c @@ -81,6 +81,7 @@ static const char version[] = #include <linux/ethtool.h> #include <linux/mii.h> #include <linux/workqueue.h> +#include <linux/of.h> #include <linux/netdevice.h> #include <linux/etherdevice.h> @@ -2394,6 +2395,12 @@ static int smc_drv_resume(struct device *dev) return 0; } +static const struct of_device_id smc91x_match[] = { + { .compatible = "smsc,smc91x", }, + {}, +} +MODULE_DEVICE_TABLE(of, smc91x_match); + static struct dev_pm_ops smc_drv_pm_ops = { .suspend = smc_drv_suspend, .resume = smc_drv_resume, @@ -2406,6 +2413,9 @@ static struct platform_driver smc_driver = { .name = CARDNAME, .owner = THIS_MODULE, .pm = &smc_drv_pm_ops, +#ifdef CONFIG_OF + .of_match_table = smc91x_match, +#endif }, };
Signed-off-by: Thomas Chou <thomas@wytron.com.tw> --- drivers/net/smc91x.c | 10 ++++++++++ 1 files changed, 10 insertions(+), 0 deletions(-)