diff options
author | Chuhong Yuan <hslester96@gmail.com> | 2019-07-22 09:37:23 -0400 |
---|---|---|
committer | Jassi Brar <jaswinder.singh@linaro.org> | 2019-09-17 01:38:43 -0400 |
commit | 2b983d124a060b7f2d0b6e53b4170c0e2b5c883c (patch) | |
tree | c8597553f691d3a7826ae82525147db5508966b1 | |
parent | f74c2bb98776e2de508f4d607cd519873065118e (diff) |
mailbox: armada-37xx-rwtm: Use device-managed registration API
Use devm_mbox_controller_register to get rid of
redundant remove function.
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
-rw-r--r-- | drivers/mailbox/armada-37xx-rwtm-mailbox.c | 14 |
1 files changed, 1 insertions, 13 deletions
diff --git a/drivers/mailbox/armada-37xx-rwtm-mailbox.c b/drivers/mailbox/armada-37xx-rwtm-mailbox.c index 97f90e97a83c..19f086716dc5 100644 --- a/drivers/mailbox/armada-37xx-rwtm-mailbox.c +++ b/drivers/mailbox/armada-37xx-rwtm-mailbox.c | |||
@@ -180,7 +180,7 @@ static int armada_37xx_mbox_probe(struct platform_device *pdev) | |||
180 | mbox->controller.ops = &a37xx_mbox_ops; | 180 | mbox->controller.ops = &a37xx_mbox_ops; |
181 | mbox->controller.txdone_irq = true; | 181 | mbox->controller.txdone_irq = true; |
182 | 182 | ||
183 | ret = mbox_controller_register(&mbox->controller); | 183 | ret = devm_mbox_controller_register(mbox->dev, &mbox->controller); |
184 | if (ret) { | 184 | if (ret) { |
185 | dev_err(&pdev->dev, "Could not register mailbox controller\n"); | 185 | dev_err(&pdev->dev, "Could not register mailbox controller\n"); |
186 | return ret; | 186 | return ret; |
@@ -190,17 +190,6 @@ static int armada_37xx_mbox_probe(struct platform_device *pdev) | |||
190 | return ret; | 190 | return ret; |
191 | } | 191 | } |
192 | 192 | ||
193 | static int armada_37xx_mbox_remove(struct platform_device *pdev) | ||
194 | { | ||
195 | struct a37xx_mbox *mbox = platform_get_drvdata(pdev); | ||
196 | |||
197 | if (!mbox) | ||
198 | return -EINVAL; | ||
199 | |||
200 | mbox_controller_unregister(&mbox->controller); | ||
201 | |||
202 | return 0; | ||
203 | } | ||
204 | 193 | ||
205 | static const struct of_device_id armada_37xx_mbox_match[] = { | 194 | static const struct of_device_id armada_37xx_mbox_match[] = { |
206 | { .compatible = "marvell,armada-3700-rwtm-mailbox" }, | 195 | { .compatible = "marvell,armada-3700-rwtm-mailbox" }, |
@@ -211,7 +200,6 @@ MODULE_DEVICE_TABLE(of, armada_37xx_mbox_match); | |||
211 | 200 | ||
212 | static struct platform_driver armada_37xx_mbox_driver = { | 201 | static struct platform_driver armada_37xx_mbox_driver = { |
213 | .probe = armada_37xx_mbox_probe, | 202 | .probe = armada_37xx_mbox_probe, |
214 | .remove = armada_37xx_mbox_remove, | ||
215 | .driver = { | 203 | .driver = { |
216 | .name = DRIVER_NAME, | 204 | .name = DRIVER_NAME, |
217 | .of_match_table = armada_37xx_mbox_match, | 205 | .of_match_table = armada_37xx_mbox_match, |