drivers/media/video i2c drivers update
PATCH 1/1 drivers/media/video i2c drivers update
Hi,
This patch is a minor fix for two i2c modules -- it makes them catch kernel_thread() failures correctly.
Please apply,
Gerd
drivers/media/video/msp3400.c +7 -8
@@ -50,10 +50,6 @@#include <asm/semaphore.h> #include <asm/pgtable.h> -/* kernel_thread */ -#define __KERNEL_SYSCALLS__ -#include <linux/unistd.h> -#include <media/audiochip.h> #include "msp3400.h"
@@ -1262,7 +1258,7 @@DECLARE_MUTEX_LOCKED (sem);struct msp3400c *msp;struct i2c_client *c; -int i; +int i, rc; client_template.adapter = adap; client_template.addr = addr;
@@ -1345,9 +1341,12 @@/* startup control thread */ msp->notify = &sem; -kernel_thread (msp->simple ? msp3410d_thread : msp3400c_thread, - (void *)c,0 ); -down (&sem); + rc =kernel_thread (msp->simple ? msp3410d_thread : msp3400c_thread, + (void *)c,0 ); +if (rc <0 ) +printk (KERN_WARNING "msp34xx: kernel_thread() failed\n" ); +else +down (&sem); msp->notify =NULL ;wake_up_interruptible (&msp->wq);
drivers/media/video/tda9887.c +3 -5
@@ -439,11 +439,9 @@ };static struct i2c_client client_template = { - .flags =I2C_CLIENT_ALLOW_USE , - .driver = &driver, - .dev = { - .name ="tda9887" , - }, +I2C_DEVNAME ("tda9887" ), + .flags =I2C_CLIENT_ALLOW_USE , + .driver = &driver, };static int tda9887_init_module (void )
drivers/media/video/tvaudio.c +7 -2
@@ -1420,6 +1420,7 @@ {struct CHIPSTATE *chip;struct CHIPDESC *desc; +int rc; chip =kmalloc (sizeof (*chip),GFP_KERNEL );if (!chip)
@@ -1487,8 +1488,12 @@ chip->wt.function = chip_thread_wake; chip->wt.data = (unsigned long )chip;init_waitqueue_head (&chip->wq); -kernel_thread (chip_thread,(void *)chip,0 ); -down (&sem); + rc =kernel_thread (chip_thread,(void *)chip,0 ); +if (rc <0 ) +printk (KERN_WARNING "%s: kernel_thread() failed\n" , +i2c_clientname (&chip->c)); +else +down (&sem); chip->notify =NULL ;wake_up_interruptible (&chip->wq); }
Signature · 1 line
sigfault