From: Chuhong Yuan <hslester96@gmail.com>
To: unlisted-recipients:; (no To-header on input)
Cc: Darren Hart <dvhart@infradead.org>,
Andy Shevchenko <andy@infradead.org>,
Thomas Gleixner <tglx@linutronix.de>,
Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
"H . Peter Anvin" <hpa@linux.intel.com>,
x86@kernel.org, Bruce Beare <bruce.j.beare@intel.com>,
Sheng Yang <sheng@linux.intel.com>,
Yunhong Jiang <yunhong.jiang@intel.com>,
Alan Cox <alan@linux.intel.com>,
platform-driver-x86@vger.kernel.org,
linux-kernel@vger.kernel.org, Chuhong Yuan <hslester96@gmail.com>
Subject: [PATCH] x86/platform/goldfish: add a check for platform_device_register_simple
Date: Tue, 10 Dec 2019 00:22:30 +0800 [thread overview]
Message-ID: <20191209162230.14991-1-hslester96@gmail.com> (raw)
goldfish_init() misses a check for platform_device_register_simple().
Add a check to fix it.
Fixes: ddd70cf93d78 ("goldfish: platform device for x86")
Signed-off-by: Chuhong Yuan <hslester96@gmail.com>
---
arch/x86/platform/goldfish/goldfish.c | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/arch/x86/platform/goldfish/goldfish.c b/arch/x86/platform/goldfish/goldfish.c
index 6b6f8b4360dd..e9694baf6e72 100644
--- a/arch/x86/platform/goldfish/goldfish.c
+++ b/arch/x86/platform/goldfish/goldfish.c
@@ -44,11 +44,16 @@ __setup("goldfish", goldfish_setup);
static int __init goldfish_init(void)
{
+ struct platform_device *pdev;
+
if (!goldfish_enable)
return -ENODEV;
- platform_device_register_simple("goldfish_pdev_bus", -1,
- goldfish_pdev_bus_resources, 2);
+ pdev = platform_device_register_simple("goldfish_pdev_bus", -1,
+ goldfish_pdev_bus_resources, 2);
+ if (IS_ERR(pdev))
+ return PTR_ERR(pdev);
+
return 0;
}
device_initcall(goldfish_init);
--
2.24.0
next reply other threads:[~2019-12-09 16:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-12-09 16:22 Chuhong Yuan [this message]
2019-12-09 17:55 ` [PATCH] x86/platform/goldfish: add a check for platform_device_register_simple Andy Shevchenko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191209162230.14991-1-hslester96@gmail.com \
--to=hslester96@gmail.com \
--cc=alan@linux.intel.com \
--cc=andy@infradead.org \
--cc=bp@alien8.de \
--cc=bruce.j.beare@intel.com \
--cc=dvhart@infradead.org \
--cc=hpa@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=platform-driver-x86@vger.kernel.org \
--cc=sheng@linux.intel.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
--cc=yunhong.jiang@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox