diff options
Diffstat (limited to 'drivers/media/platform/tegra-cec')
-rw-r--r-- | drivers/media/platform/tegra-cec/Makefile | 1 | ||||
-rw-r--r-- | drivers/media/platform/tegra-cec/tegra_cec.c | 29 | ||||
-rw-r--r-- | drivers/media/platform/tegra-cec/tegra_cec.h | 13 |
3 files changed, 8 insertions, 35 deletions
diff --git a/drivers/media/platform/tegra-cec/Makefile b/drivers/media/platform/tegra-cec/Makefile index f3d81127589f..97e57c7493c0 100644 --- a/drivers/media/platform/tegra-cec/Makefile +++ b/drivers/media/platform/tegra-cec/Makefile @@ -1 +1,2 @@ +# SPDX-License-Identifier: GPL-2.0-only obj-$(CONFIG_VIDEO_TEGRA_HDMI_CEC) += tegra_cec.o diff --git a/drivers/media/platform/tegra-cec/tegra_cec.c b/drivers/media/platform/tegra-cec/tegra_cec.c index aba488cd0e64..6498b2d0492e 100644 --- a/drivers/media/platform/tegra-cec/tegra_cec.c +++ b/drivers/media/platform/tegra-cec/tegra_cec.c @@ -1,3 +1,4 @@ +// SPDX-License-Identifier: GPL-2.0-only /* * Tegra CEC implementation * @@ -8,18 +9,6 @@ * Conversion to the CEC framework and to the mainline kernel: * * Copyright 2016-2017 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #include <linux/module.h> @@ -327,21 +316,15 @@ static const struct cec_adap_ops tegra_cec_ops = { static int tegra_cec_probe(struct platform_device *pdev) { - struct platform_device *hdmi_dev; - struct device_node *np; + struct device *hdmi_dev; struct tegra_cec *cec; struct resource *res; int ret = 0; - np = of_parse_phandle(pdev->dev.of_node, "hdmi-phandle", 0); + hdmi_dev = cec_notifier_parse_hdmi_phandle(&pdev->dev); - if (!np) { - dev_err(&pdev->dev, "Failed to find hdmi node in device tree\n"); - return -ENODEV; - } - hdmi_dev = of_find_device_by_node(np); - if (hdmi_dev == NULL) - return -EPROBE_DEFER; + if (IS_ERR(hdmi_dev)) + return PTR_ERR(hdmi_dev); cec = devm_kzalloc(&pdev->dev, sizeof(struct tegra_cec), GFP_KERNEL); @@ -400,7 +383,7 @@ static int tegra_cec_probe(struct platform_device *pdev) goto clk_error; } - cec->notifier = cec_notifier_get(&hdmi_dev->dev); + cec->notifier = cec_notifier_get(hdmi_dev); if (!cec->notifier) { ret = -ENOMEM; goto clk_error; diff --git a/drivers/media/platform/tegra-cec/tegra_cec.h b/drivers/media/platform/tegra-cec/tegra_cec.h index e301513daa87..32d7d69f9491 100644 --- a/drivers/media/platform/tegra-cec/tegra_cec.h +++ b/drivers/media/platform/tegra-cec/tegra_cec.h @@ -1,3 +1,4 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ /* * Tegra CEC register definitions * @@ -8,18 +9,6 @@ * Conversion to the CEC framework and to the mainline kernel: * * Copyright 2016-2017 Cisco Systems, Inc. and/or its affiliates. All rights reserved. - * - * This program is free software; you can redistribute it and/or modify it - * under the terms and conditions of the GNU General Public License, - * version 2, as published by the Free Software Foundation. - * - * This program is distributed in the hope it will be useful, but WITHOUT - * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for - * more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef TEGRA_CEC_H |