mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-19 18:24:14 +08:00
2397134ce2
The ptr_ret.cocci script generates the following warning: arch/x86/kernel/pcspeaker.c:12:8-14: WARNING: PTR_ERR_OR_ZERO can be used Use PTR_ERR_OR_ZERO() rather than an open-coded version to fix this. Signed-off-by: YueHaibing <yuehaibing@huawei.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: gregkh@linuxfoundation.org Cc: kstewart@linuxfoundation.org Cc: pombredanne@nexb.com Link: http://lkml.kernel.org/r/20180720073213.14996-1-yuehaibing@huawei.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
15 lines
309 B
C
15 lines
309 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
#include <linux/platform_device.h>
|
|
#include <linux/err.h>
|
|
#include <linux/init.h>
|
|
|
|
static __init int add_pcspkr(void)
|
|
{
|
|
struct platform_device *pd;
|
|
|
|
pd = platform_device_register_simple("pcspkr", -1, NULL, 0);
|
|
|
|
return PTR_ERR_OR_ZERO(pd);
|
|
}
|
|
device_initcall(add_pcspkr);
|