Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[media] radio-si470x: convert to use request_threaded_irq()

Signed-off-by: Joonyoung Shim <jy0922.shim@samsung.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>

authored by

Joonyoung Shim and committed by
Mauro Carvalho Chehab
474fdc08 949cf31c

+9 -24
+9 -23
drivers/media/radio/si470x/radio-si470x-i2c.c
··· 262 262 **************************************************************************/ 263 263 264 264 /* 265 - * si470x_i2c_interrupt_work - rds processing function 265 + * si470x_i2c_interrupt - interrupt handler 266 266 */ 267 - static void si470x_i2c_interrupt_work(struct work_struct *work) 267 + static irqreturn_t si470x_i2c_interrupt(int irq, void *dev_id) 268 268 { 269 - struct si470x_device *radio = container_of(work, 270 - struct si470x_device, radio_work); 269 + struct si470x_device *radio = dev_id; 271 270 unsigned char regnr; 272 271 unsigned char blocknum; 273 272 unsigned short bler; /* rds block errors */ ··· 277 278 /* check Seek/Tune Complete */ 278 279 retval = si470x_get_register(radio, STATUSRSSI); 279 280 if (retval < 0) 280 - return; 281 + goto end; 281 282 282 283 if (radio->registers[STATUSRSSI] & STATUSRSSI_STC) 283 284 complete(&radio->completion); 284 285 285 286 /* safety checks */ 286 287 if ((radio->registers[SYSCONFIG1] & SYSCONFIG1_RDS) == 0) 287 - return; 288 + goto end; 288 289 289 290 /* Update RDS registers */ 290 291 for (regnr = 1; regnr < RDS_REGISTER_NUM; regnr++) { 291 292 retval = si470x_get_register(radio, STATUSRSSI + regnr); 292 293 if (retval < 0) 293 - return; 294 + goto end; 294 295 } 295 296 296 297 /* get rds blocks */ 297 298 if ((radio->registers[STATUSRSSI] & STATUSRSSI_RDSR) == 0) 298 299 /* No RDS group ready, better luck next time */ 299 - return; 300 + goto end; 300 301 301 302 for (blocknum = 0; blocknum < 4; blocknum++) { 302 303 switch (blocknum) { ··· 350 351 351 352 if (radio->wr_index != radio->rd_index) 352 353 wake_up_interruptible(&radio->read_queue); 353 - } 354 354 355 - 356 - /* 357 - * si470x_i2c_interrupt - interrupt handler 358 - */ 359 - static irqreturn_t si470x_i2c_interrupt(int irq, void *dev_id) 360 - { 361 - struct si470x_device *radio = dev_id; 362 - 363 - if (!work_pending(&radio->radio_work)) 364 - schedule_work(&radio->radio_work); 365 - 355 + end: 366 356 return IRQ_HANDLED; 367 357 } 368 358 ··· 373 385 goto err_initial; 374 386 } 375 387 376 - INIT_WORK(&radio->radio_work, si470x_i2c_interrupt_work); 377 388 radio->users = 0; 378 389 radio->client = client; 379 390 mutex_init(&radio->lock); ··· 441 454 radio->stci_enabled = true; 442 455 init_completion(&radio->completion); 443 456 444 - retval = request_irq(client->irq, si470x_i2c_interrupt, 457 + retval = request_threaded_irq(client->irq, NULL, si470x_i2c_interrupt, 445 458 IRQF_TRIGGER_FALLING, DRIVER_NAME, radio); 446 459 if (retval) { 447 460 dev_err(&client->dev, "Failed to register interrupt\n"); ··· 479 492 struct si470x_device *radio = i2c_get_clientdata(client); 480 493 481 494 free_irq(client->irq, radio); 482 - cancel_work_sync(&radio->radio_work); 483 495 video_unregister_device(radio->videodev); 484 496 kfree(radio); 485 497
-1
drivers/media/radio/si470x/radio-si470x.h
··· 182 182 183 183 #if defined(CONFIG_I2C_SI470X) || defined(CONFIG_I2C_SI470X_MODULE) 184 184 struct i2c_client *client; 185 - struct work_struct radio_work; 186 185 #endif 187 186 }; 188 187