| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * Copyright Altera Corporation (C) 2013-2014. All rights reserved |
|---|
| 3 | | - * |
|---|
| 4 | | - * This program is free software; you can redistribute it and/or modify it |
|---|
| 5 | | - * under the terms and conditions of the GNU General Public License, |
|---|
| 6 | | - * version 2, as published by the Free Software Foundation. |
|---|
| 7 | | - * |
|---|
| 8 | | - * This program is distributed in the hope it will be useful, but WITHOUT |
|---|
| 9 | | - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|---|
| 10 | | - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
|---|
| 11 | | - * more details. |
|---|
| 12 | | - * |
|---|
| 13 | | - * You should have received a copy of the GNU General Public License along with |
|---|
| 14 | | - * this program. If not, see <http://www.gnu.org/licenses/>. |
|---|
| 15 | 4 | */ |
|---|
| 16 | 5 | |
|---|
| 17 | 6 | #include <linux/device.h> |
|---|
| .. | .. |
|---|
| 341 | 330 | } |
|---|
| 342 | 331 | } |
|---|
| 343 | 332 | |
|---|
| 344 | | - ret = mbox_controller_register(&mbox->controller); |
|---|
| 333 | + ret = devm_mbox_controller_register(&pdev->dev, &mbox->controller); |
|---|
| 345 | 334 | if (ret) { |
|---|
| 346 | 335 | dev_err(&pdev->dev, "Register mailbox failed\n"); |
|---|
| 347 | 336 | goto err; |
|---|
| .. | .. |
|---|
| 350 | 339 | platform_set_drvdata(pdev, mbox); |
|---|
| 351 | 340 | err: |
|---|
| 352 | 341 | 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 | 342 | } |
|---|
| 366 | 343 | |
|---|
| 367 | 344 | static const struct of_device_id altera_mbox_match[] = { |
|---|
| .. | .. |
|---|
| 373 | 350 | |
|---|
| 374 | 351 | static struct platform_driver altera_mbox_driver = { |
|---|
| 375 | 352 | .probe = altera_mbox_probe, |
|---|
| 376 | | - .remove = altera_mbox_remove, |
|---|
| 377 | 353 | .driver = { |
|---|
| 378 | 354 | .name = DRIVER_NAME, |
|---|
| 379 | 355 | .of_match_table = altera_mbox_match, |
|---|