From: Bo Yang Date: Wed, 30 Aug 2017 06:56:08 +0000 (+0800) Subject: jtag: add check for class_register X-Git-Tag: khadas-vims-v0.9.6-release~2844 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aa222a2e4c47dfc9ebf1197e48f3d1bd3fec15e9;p=platform%2Fkernel%2Flinux-amlogic.git jtag: add check for class_register PD#150090: driver defect clean up: #28 Change-Id: Ib75bbc51cf415b9ccdf8db9bbec7ae764b06e036 Signed-off-by: Bo Yang --- 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);