diff options
| author | Thierry Reding <treding@nvidia.com> | 2018-12-20 12:19:49 -0500 |
|---|---|---|
| committer | Jassi Brar <jaswinder.singh@linaro.org> | 2018-12-21 17:49:25 -0500 |
| commit | e73cb83c807b3a1c3c430b646668ce358b13ee74 (patch) | |
| tree | 2d54331a2c16b8dcbcdc94f4bcc3a258668fd2a8 /drivers/mailbox | |
| parent | 6267ee6afae0a3c130dc585118dd60e090c6448b (diff) | |
mailbox: hi3660: Use device-managed registration API
Get rid of some boilerplate driver removal code by using the newly added
device-managed registration API.
Tested-by: Leo Yan <leo.yan@linaro.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
Diffstat (limited to 'drivers/mailbox')
| -rw-r--r-- | drivers/mailbox/hi3660-mailbox.c | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/drivers/mailbox/hi3660-mailbox.c b/drivers/mailbox/hi3660-mailbox.c index f9aed5d8f9f1..53f4bc2488c5 100644 --- a/drivers/mailbox/hi3660-mailbox.c +++ b/drivers/mailbox/hi3660-mailbox.c | |||
| @@ -265,7 +265,7 @@ static int hi3660_mbox_probe(struct platform_device *pdev) | |||
| 265 | for (ch = 0; ch < MBOX_CHAN_MAX; ch++) | 265 | for (ch = 0; ch < MBOX_CHAN_MAX; ch++) |
| 266 | chan[ch].con_priv = (void *)ch; | 266 | chan[ch].con_priv = (void *)ch; |
| 267 | 267 | ||
| 268 | err = mbox_controller_register(&mbox->controller); | 268 | err = devm_mbox_controller_register(dev, &mbox->controller); |
| 269 | if (err) { | 269 | if (err) { |
| 270 | dev_err(dev, "Failed to register mailbox %d\n", err); | 270 | dev_err(dev, "Failed to register mailbox %d\n", err); |
| 271 | return err; | 271 | return err; |
| @@ -276,17 +276,8 @@ static int hi3660_mbox_probe(struct platform_device *pdev) | |||
| 276 | return 0; | 276 | return 0; |
| 277 | } | 277 | } |
| 278 | 278 | ||
| 279 | static int hi3660_mbox_remove(struct platform_device *pdev) | ||
| 280 | { | ||
| 281 | struct hi3660_mbox *mbox = platform_get_drvdata(pdev); | ||
| 282 | |||
| 283 | mbox_controller_unregister(&mbox->controller); | ||
| 284 | return 0; | ||
| 285 | } | ||
| 286 | |||
| 287 | static struct platform_driver hi3660_mbox_driver = { | 279 | static struct platform_driver hi3660_mbox_driver = { |
| 288 | .probe = hi3660_mbox_probe, | 280 | .probe = hi3660_mbox_probe, |
| 289 | .remove = hi3660_mbox_remove, | ||
| 290 | .driver = { | 281 | .driver = { |
| 291 | .name = "hi3660-mbox", | 282 | .name = "hi3660-mbox", |
| 292 | .of_match_table = hi3660_mbox_of_match, | 283 | .of_match_table = hi3660_mbox_of_match, |
