From 312ad9dad3680704898b7dbfa33c41885959a757 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Mathieu=20B=C3=A9rard?= Date: Sat, 9 Sep 2006 03:00:20 +0000 Subject: [PATCH] * Fix bug in init.c: If specific feature init function fail we have to decrement kref on backend * Fix forgotten TSM40 table entry in display.c * Add printk in case of smi command error --- display.c | 1 + init.c | 9 +++++++-- nbsmi.c | 3 +++ omnibook.h | 2 +- wireless.c | 4 ++-- 5 files changed, 14 insertions(+), 5 deletions(-) diff --git a/display.c b/display.c index 8f3b50b..f582c70 100644 --- a/display.c +++ b/display.c @@ -82,6 +82,7 @@ static int __init omnibook_display_init(struct omnibook_operation *io_op) static struct omnibook_tbl display_table[] __initdata = { { TSM30X, {ACPI, }}, + { TSM40, {SMI, }}, { XE3GF|TSP10|TSM30X|TSM40, SIMPLE_BYTE(EC,XE3GF_STA1,XE3GF_SHDD_MASK)}, { XE3GC, SIMPLE_BYTE(EC,XE3GC_STA1,XE3GC_CRTI_MASK)}, { OB500|OB510|OB6000|OB6100|XE4500, SIMPLE_BYTE(EC,OB500_STA1,OB500_CRTS_MASK)}, diff --git a/init.c b/init.c index b39face..0e76110 100644 --- a/init.c +++ b/init.c @@ -220,9 +220,12 @@ static int __init omnibook_init(struct omnibook_feature *feature) /* * Specific feature init code */ - if (feature->init && (retval = feature->init(feature->io_op))) + if (feature->init && (retval = feature->init(feature->io_op))) { + printk(O_ERR "Init function of %s failed with error %i.\n", + feature->name, + retval); goto err; - + } /* * procfs file setup */ @@ -260,6 +263,8 @@ static int __init omnibook_init(struct omnibook_feature *feature) list_add_tail(&feature->list, &omnibook_available_feature->list); return 0; err: + if (feature->io_op && feature->io_op->backend->exit) + feature->io_op->backend->exit(feature->io_op); kfree(feature->io_op); return retval; } diff --git a/nbsmi.c b/nbsmi.c index 7734d73..0e3bdbc 100644 --- a/nbsmi.c +++ b/nbsmi.c @@ -175,6 +175,9 @@ static int nbsmi_smi_command(u16 function,const u8 *inputbuffer, u8 *outputbuffe BUG(); } + if(retval) + printk(O_ERR "smi_command failed with error %i.\n", retval); + for(count = 0; count < BUFFER_SIZE; count++) { outb( count + start_offset, RTC_PORT(2) ); *(outputbuffer + count) = inb( RTC_PORT(3) ); diff --git a/omnibook.h b/omnibook.h index 451f270..d3b1db7 100644 --- a/omnibook.h +++ b/omnibook.h @@ -26,7 +26,7 @@ */ #define OMNIBOOK_MODULE_NAME "omnibook" -#define OMNIBOOK_MODULE_VERSION "2.20060816" +#define OMNIBOOK_MODULE_VERSION "2.20060000" /* * EC types diff --git a/wireless.c b/wireless.c index 91e2ec2..bc9782a 100644 --- a/wireless.c +++ b/wireless.c @@ -82,8 +82,8 @@ static int __init omnibook_wifi_init(struct omnibook_operation *io_op) * Shared with bluetooth.c */ struct omnibook_tbl wireless_table[] __initdata = { - { TSM30X, {ACPI, 0, 0, 0, 0, 0}}, /* stubs to select backend */ - { TSM40, {SMI, 0, 0, 0, 0, 0}}, /* stubs to select backend */ + { TSM30X, {ACPI,}}, /* stubs to select backend */ + { TSM40, {SMI,}}, /* stubs to select backend */ { 0,} }; -- 2.43.5