Commit 96092a79 authored by Russell King's avatar Russell King

Merge flint.arm.linux.org.uk:/usr/src/linux-bk-2.5/linux-2.5

into flint.arm.linux.org.uk:/usr/src/linux-bk-2.5/linux-2.5-pcmcia
parents 32538906 5dbb10ef
...@@ -106,17 +106,8 @@ static struct device_driver sa11x0_pcmcia_driver = { ...@@ -106,17 +106,8 @@ static struct device_driver sa11x0_pcmcia_driver = {
.remove = sa11xx_drv_pcmcia_remove, .remove = sa11xx_drv_pcmcia_remove,
.name = "sa11x0-pcmcia", .name = "sa11x0-pcmcia",
.bus = &platform_bus_type, .bus = &platform_bus_type,
.devclass = &pcmcia_socket_class, /* .suspend = pcmcia_socket_dev_suspend,*/
.suspend = pcmcia_socket_dev_suspend, /* .resume = pcmcia_socket_dev_resume,*/
.resume = pcmcia_socket_dev_resume,
};
static struct platform_device sa11x0_pcmcia_device = {
.name = "sa11x0-pcmcia",
.id = 0,
.dev = {
.name = "Intel Corporation SA11x0 [PCMCIA]",
},
}; };
/* sa11x0_pcmcia_init() /* sa11x0_pcmcia_init()
...@@ -129,16 +120,7 @@ static struct platform_device sa11x0_pcmcia_device = { ...@@ -129,16 +120,7 @@ static struct platform_device sa11x0_pcmcia_device = {
*/ */
static int __init sa11x0_pcmcia_init(void) static int __init sa11x0_pcmcia_init(void)
{ {
int ret; return driver_register(&sa11x0_pcmcia_driver);
ret = driver_register(&sa11x0_pcmcia_driver);
if (ret == 0) {
ret = platform_device_register(&sa11x0_pcmcia_device);
if (ret)
driver_unregister(&sa11x0_pcmcia_driver);
}
return ret;
} }
/* sa11x0_pcmcia_exit() /* sa11x0_pcmcia_exit()
...@@ -148,7 +130,6 @@ static int __init sa11x0_pcmcia_init(void) ...@@ -148,7 +130,6 @@ static int __init sa11x0_pcmcia_init(void)
*/ */
static void __exit sa11x0_pcmcia_exit(void) static void __exit sa11x0_pcmcia_exit(void)
{ {
platform_device_unregister(&sa11x0_pcmcia_device);
driver_unregister(&sa11x0_pcmcia_driver); driver_unregister(&sa11x0_pcmcia_driver);
} }
......
...@@ -178,8 +178,8 @@ static struct sa1111_driver pcmcia_driver = { ...@@ -178,8 +178,8 @@ static struct sa1111_driver pcmcia_driver = {
.bus = &sa1111_bus_type, .bus = &sa1111_bus_type,
.probe = pcmcia_probe, .probe = pcmcia_probe,
.remove = __devexit_p(pcmcia_remove), .remove = __devexit_p(pcmcia_remove),
.suspend = pcmcia_socket_dev_suspend, /* .suspend = pcmcia_socket_dev_suspend,*/
.resume = pcmcia_socket_dev_resume, /* .resume = pcmcia_socket_dev_resume,*/
}, },
.devid = SA1111_DEVID_PCMCIA, .devid = SA1111_DEVID_PCMCIA,
}; };
......
...@@ -806,6 +806,13 @@ int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, in ...@@ -806,6 +806,13 @@ int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, in
unsigned int cpu_clock; unsigned int cpu_clock;
int ret, i; int ret, i;
/*
* set default MECR calculation if the board specific
* code did not specify one...
*/
if (!ops->socket_get_timing)
ops->socket_get_timing = sa1100_pcmcia_default_mecr_timing;
cls = kmalloc(sizeof(struct pcmcia_socket_class_data), GFP_KERNEL); cls = kmalloc(sizeof(struct pcmcia_socket_class_data), GFP_KERNEL);
if (!cls) { if (!cls) {
ret = -ENOMEM; ret = -ENOMEM;
...@@ -815,13 +822,10 @@ int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, in ...@@ -815,13 +822,10 @@ int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, in
memset(cls, 0, sizeof(struct pcmcia_socket_class_data)); memset(cls, 0, sizeof(struct pcmcia_socket_class_data));
cls->ops = &sa11xx_pcmcia_operations; cls->ops = &sa11xx_pcmcia_operations;
cls->nsock = nr; cls->nsock = nr;
cls->class_dev.class = &pcmcia_socket_class;
/* cls->class_dev.dev = dev;
* set default MECR calculation if the board specific strlcpy(cls->class_dev.class_id, dev->bus_id, BUS_ID_SIZE);
* code did not specify one... class_set_devdata(&cls->class_dev, cls);
*/
if (!ops->socket_get_timing)
ops->socket_get_timing = sa1100_pcmcia_default_mecr_timing;
cpu_clock = cpufreq_get(0); cpu_clock = cpufreq_get(0);
...@@ -901,7 +905,9 @@ int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, in ...@@ -901,7 +905,9 @@ int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, in
add_timer(&skt->poll_timer); add_timer(&skt->poll_timer);
} }
dev->class_data = cls; dev_set_drvdata(dev, cls);
class_device_register(&cls->class_dev);
return 0; return 0;
do { do {
...@@ -934,10 +940,11 @@ EXPORT_SYMBOL(sa11xx_drv_pcmcia_probe); ...@@ -934,10 +940,11 @@ EXPORT_SYMBOL(sa11xx_drv_pcmcia_probe);
int sa11xx_drv_pcmcia_remove(struct device *dev) int sa11xx_drv_pcmcia_remove(struct device *dev)
{ {
struct pcmcia_socket_class_data *cls = dev->class_data; struct pcmcia_socket_class_data *cls = dev_get_drvdata(dev);
int i; int i;
dev->class_data = NULL; class_device_unregister(&cls->class_dev);
dev_set_drvdata(dev, NULL);
for (i = 0; i < cls->nsock; i++) { for (i = 0; i < cls->nsock; i++) {
struct sa1100_pcmcia_socket *skt = PCMCIA_SOCKET(cls->sock_offset + i); struct sa1100_pcmcia_socket *skt = PCMCIA_SOCKET(cls->sock_offset + i);
...@@ -977,6 +984,7 @@ static void sa1100_pcmcia_update_mecr(unsigned int clock) ...@@ -977,6 +984,7 @@ static void sa1100_pcmcia_update_mecr(unsigned int clock)
for (sock = 0; sock < SA1100_PCMCIA_MAX_SOCK; ++sock) { for (sock = 0; sock < SA1100_PCMCIA_MAX_SOCK; ++sock) {
struct sa1100_pcmcia_socket *skt = PCMCIA_SOCKET(sock); struct sa1100_pcmcia_socket *skt = PCMCIA_SOCKET(sock);
if (skt->ops)
sa1100_pcmcia_set_mecr(skt, clock); sa1100_pcmcia_set_mecr(skt, clock);
} }
} }
......
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