diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2010-12-16 14:06:35 +0100 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-12-16 22:14:32 +0100 |
commit | 35c64e5d13c3d7d8c4ad061ad5e20498b9160c24 (patch) | |
tree | 7fe8761e76c9dd07a785dacba0837af93603763d /drivers/serial/s3c2440.c | |
parent | Serial: Avoid unbalanced IRQ wake disable during resume (diff) | |
download | linux-35c64e5d13c3d7d8c4ad061ad5e20498b9160c24.tar.xz linux-35c64e5d13c3d7d8c4ad061ad5e20498b9160c24.zip |
drivers: serial: apbuart: Handle OF failures gracefully
The apbuart driver depends on OF and relies on everything being
available. So if it's probed on a platform which has OF support, but
no device tree is available it crashes. Triggered by the upcoming x86
OF support in randconfig testing.
Further it's inconsistent vs. the probing and exiting from the
of_match loop.
Make it robust and consistent:
- check the availablility of OF nodes before dereferencing
- return -ENODEV when the device tree lookup fails
- return -ENODEV when no uart port configuration is found
- return -ENODEV when invalid uart port configuration is found
Remove the enum_done check while at it. Driver init functions are only
called once. Remove the pointless vendor and device queries as well.
Reported-by: Ingo Molnar <mingo.elte.hu>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: Grant Likely <grant.likely@secretlab.ca>
Cc: Kristoffer Glembo <kristoffer@gaisler.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/serial/s3c2440.c')
0 files changed, 0 insertions, 0 deletions