From aa222a2e4c47dfc9ebf1197e48f3d1bd3fec15e9 Mon Sep 17 00:00:00 2001 From: Bo Yang Date: Wed, 30 Aug 2017 14:56:08 +0800 Subject: [PATCH] jtag: add check for class_register PD#150090: driver defect clean up: #28 Change-Id: Ib75bbc51cf415b9ccdf8db9bbec7ae764b06e036 Signed-off-by: Bo Yang --- drivers/amlogic/jtag/meson_jtag.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/amlogic/jtag/meson_jtag.c b/drivers/amlogic/jtag/meson_jtag.c index 4e8b4cb..ddca757 100644 --- a/drivers/amlogic/jtag/meson_jtag.c +++ b/drivers/amlogic/jtag/meson_jtag.c @@ -585,7 +585,11 @@ static int aml_jtag_probe(struct platform_device *pdev) jdev->cls.name = AML_JTAG_NAME; jdev->cls.owner = THIS_MODULE; jdev->cls.class_attrs = aml_jtag_attrs; - class_register(&jdev->cls); + ret = class_register(&jdev->cls); + if (ret) { + pr_err("couldn't register sysfs class\n"); + return ret; + } /* setup jtag */ aml_jtag_setup(jdev); -- 2.7.4