mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-04 16:15:11 +00:00
powerpc/powernv: Return for invalid IMC domain
[ Upstream commitb59bd3527f
] Currently init_imc_pmu() can fail either because we try to register an IMC unit with an invalid domain (i.e an IMC node not supported by the kernel) or something went wrong while registering a valid IMC unit. In both the cases kernel provides a 'Register failed' error message. For example when trace-imc node is not supported by the kernel, but skiboot advertises a trace-imc node we print: IMC Unknown Device type IMC PMU (null) Register failed To avoid confusion just print the unknown device type message, before attempting PMU registration, so the second message isn't printed. Fixes:8f95faaac5
("powerpc/powernv: Detect and create IMC device") Reported-by: Pavaman Subramaniyam <pavsubra@in.ibm.com> Signed-off-by: Anju T Sudhakar <anju@linux.vnet.ibm.com> Reviewed-by: Madhavan Srinivasan <maddy@linux.vnet.ibm.com> [mpe: Reword change log a bit] Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
535e73cdbf
commit
8a58d4a26b
1 changed files with 4 additions and 0 deletions
|
@ -87,6 +87,10 @@ static int imc_pmu_create(struct device_node *parent, int pmu_index, int domain)
|
|||
struct imc_pmu *pmu_ptr;
|
||||
u32 offset;
|
||||
|
||||
/* Return for unknown domain */
|
||||
if (domain < 0)
|
||||
return -EINVAL;
|
||||
|
||||
/* memory for pmu */
|
||||
pmu_ptr = kzalloc(sizeof(struct imc_pmu), GFP_KERNEL);
|
||||
if (!pmu_ptr)
|
||||
|
|
Loading…
Reference in a new issue