Commit 44d0e199 authored by Ben Dooks's avatar Ben Dooks Committed by Linus Torvalds

s3cmci: update probe to use new platform id list

Use the platform id list to match the three different versions of the
hardware block that this driver supports.

This will change the prefix of the console messages produced by this
driver to be prefixed by s3c-mci instead of the hardware block name, such
as s3c2440-mci.
Signed-off-by: default avatarBen Dooks <ben@simtec.co.uk>
Cc: <linux-mmc@vger.kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent da52a7ca
...@@ -1244,11 +1244,14 @@ static inline void s3cmci_cpufreq_deregister(struct s3cmci_host *host) ...@@ -1244,11 +1244,14 @@ static inline void s3cmci_cpufreq_deregister(struct s3cmci_host *host)
} }
#endif #endif
static int __devinit s3cmci_probe(struct platform_device *pdev, int is2440) static int __devinit s3cmci_probe(struct platform_device *pdev)
{ {
struct s3cmci_host *host; struct s3cmci_host *host;
struct mmc_host *mmc; struct mmc_host *mmc;
int ret; int ret;
int is2440;
is2440 = platform_get_device_id(pdev)->driver_data;
mmc = mmc_alloc_host(sizeof(struct s3cmci_host), &pdev->dev); mmc = mmc_alloc_host(sizeof(struct s3cmci_host), &pdev->dev);
if (!mmc) { if (!mmc) {
...@@ -1473,20 +1476,22 @@ static int __devexit s3cmci_remove(struct platform_device *pdev) ...@@ -1473,20 +1476,22 @@ static int __devexit s3cmci_remove(struct platform_device *pdev)
return 0; return 0;
} }
static int __devinit s3cmci_2410_probe(struct platform_device *dev) static struct platform_device_id s3cmci_driver_ids[] = {
{ {
return s3cmci_probe(dev, 0); .name = "s3c2410-sdi",
} .driver_data = 0,
}, {
.name = "s3c2412-sdi",
.driver_data = 1,
}, {
.name = "s3c2440-sdi",
.driver_data = 1,
},
{ }
};
static int __devinit s3cmci_2412_probe(struct platform_device *dev) MODULE_DEVICE_TABLE(platform, s3cmci_driver_ids);
{
return s3cmci_probe(dev, 1);
}
static int __devinit s3cmci_2440_probe(struct platform_device *dev)
{
return s3cmci_probe(dev, 1);
}
#ifdef CONFIG_PM #ifdef CONFIG_PM
...@@ -1510,50 +1515,25 @@ static int s3cmci_resume(struct platform_device *dev) ...@@ -1510,50 +1515,25 @@ static int s3cmci_resume(struct platform_device *dev)
#endif /* CONFIG_PM */ #endif /* CONFIG_PM */
static struct platform_driver s3cmci_2410_driver = { static struct platform_driver s3cmci_driver = {
.driver.name = "s3c2410-sdi", .driver.name = "s3c-sdi",
.driver.owner = THIS_MODULE,
.probe = s3cmci_2410_probe,
.remove = __devexit_p(s3cmci_remove),
.shutdown = s3cmci_shutdown,
.suspend = s3cmci_suspend,
.resume = s3cmci_resume,
};
static struct platform_driver s3cmci_2412_driver = {
.driver.name = "s3c2412-sdi",
.driver.owner = THIS_MODULE,
.probe = s3cmci_2412_probe,
.remove = __devexit_p(s3cmci_remove),
.shutdown = s3cmci_shutdown,
.suspend = s3cmci_suspend,
.resume = s3cmci_resume,
};
static struct platform_driver s3cmci_2440_driver = {
.driver.name = "s3c2440-sdi",
.driver.owner = THIS_MODULE, .driver.owner = THIS_MODULE,
.probe = s3cmci_2440_probe, .id_table = s3cmci_driver_ids,
.probe = s3cmci_probe,
.remove = __devexit_p(s3cmci_remove), .remove = __devexit_p(s3cmci_remove),
.shutdown = s3cmci_shutdown, .shutdown = s3cmci_shutdown,
.suspend = s3cmci_suspend, .suspend = s3cmci_suspend,
.resume = s3cmci_resume, .resume = s3cmci_resume,
}; };
static int __init s3cmci_init(void) static int __init s3cmci_init(void)
{ {
platform_driver_register(&s3cmci_2410_driver); return platform_driver_register(&s3cmci_driver);
platform_driver_register(&s3cmci_2412_driver);
platform_driver_register(&s3cmci_2440_driver);
return 0;
} }
static void __exit s3cmci_exit(void) static void __exit s3cmci_exit(void)
{ {
platform_driver_unregister(&s3cmci_2410_driver); platform_driver_unregister(&s3cmci_driver);
platform_driver_unregister(&s3cmci_2412_driver);
platform_driver_unregister(&s3cmci_2440_driver);
} }
module_init(s3cmci_init); module_init(s3cmci_init);
...@@ -1562,6 +1542,3 @@ module_exit(s3cmci_exit); ...@@ -1562,6 +1542,3 @@ module_exit(s3cmci_exit);
MODULE_DESCRIPTION("Samsung S3C MMC/SD Card Interface driver"); MODULE_DESCRIPTION("Samsung S3C MMC/SD Card Interface driver");
MODULE_LICENSE("GPL v2"); MODULE_LICENSE("GPL v2");
MODULE_AUTHOR("Thomas Kleffel <tk@maintech.de>, Ben Dooks <ben-linux@fluff.org>"); MODULE_AUTHOR("Thomas Kleffel <tk@maintech.de>, Ben Dooks <ben-linux@fluff.org>");
MODULE_ALIAS("platform:s3c2410-sdi");
MODULE_ALIAS("platform:s3c2412-sdi");
MODULE_ALIAS("platform:s3c2440-sdi");
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment