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

mailbox: altera: Use device-managed registration API

Get rid of some boilerplate driver removal code by using the newly added
device-managed registration API.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>

authored by

Thierry Reding and committed by
Jassi Brar
87f63f57 4013286c

+1 -14
+1 -14
drivers/mailbox/mailbox-altera.c
··· 341 341 } 342 342 } 343 343 344 - ret = mbox_controller_register(&mbox->controller); 344 + ret = devm_mbox_controller_register(&pdev->dev, &mbox->controller); 345 345 if (ret) { 346 346 dev_err(&pdev->dev, "Register mailbox failed\n"); 347 347 goto err; ··· 350 350 platform_set_drvdata(pdev, mbox); 351 351 err: 352 352 return ret; 353 - } 354 - 355 - static int altera_mbox_remove(struct platform_device *pdev) 356 - { 357 - struct altera_mbox *mbox = platform_get_drvdata(pdev); 358 - 359 - if (!mbox) 360 - return -EINVAL; 361 - 362 - mbox_controller_unregister(&mbox->controller); 363 - 364 - return 0; 365 353 } 366 354 367 355 static const struct of_device_id altera_mbox_match[] = { ··· 361 373 362 374 static struct platform_driver altera_mbox_driver = { 363 375 .probe = altera_mbox_probe, 364 - .remove = altera_mbox_remove, 365 376 .driver = { 366 377 .name = DRIVER_NAME, 367 378 .of_match_table = altera_mbox_match,