Commit 3bb31f0d authored by Russell King's avatar Russell King

[PCMCIA] Fix sa11xx_core.c oops when changing cpu frequency.

parent fea45e9c
...@@ -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;
...@@ -816,13 +823,6 @@ int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, in ...@@ -816,13 +823,6 @@ int sa11xx_drv_pcmcia_probe(struct device *dev, struct pcmcia_low_level *ops, in
cls->ops = &sa11xx_pcmcia_operations; cls->ops = &sa11xx_pcmcia_operations;
cls->nsock = nr; cls->nsock = nr;
/*
* 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;
cpu_clock = cpufreq_get(0); cpu_clock = cpufreq_get(0);
/* /*
...@@ -977,7 +977,8 @@ static void sa1100_pcmcia_update_mecr(unsigned int clock) ...@@ -977,7 +977,8 @@ 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);
sa1100_pcmcia_set_mecr(skt, clock); if (skt->ops)
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