Linux-MIPS Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH] MIPS: Loongson: Fix return value of loongson_hwmon_init
@ 2019-11-04 13:33 Tiezhu Yang
  2019-11-04 19:06 ` Paul Burton
  0 siblings, 1 reply; 2+ messages in thread
From: Tiezhu Yang @ 2019-11-04 13:33 UTC (permalink / raw)
  To: Paul Burton, Ralf Baechle, James Hogan, Huacai Chen, Jiaxun Yang
  Cc: linux-mips, linux-kernel

When call function hwmon_device_register failed, use the actual
return value instead of always -ENOMEM.

Fixes: 64f09aa967e1 ("MIPS: Loongson-3: Add CPU Hwmon platform driver")
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
---
 drivers/platform/mips/cpu_hwmon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/platform/mips/cpu_hwmon.c b/drivers/platform/mips/cpu_hwmon.c
index 1833b51..0d27cb7 100644
--- a/drivers/platform/mips/cpu_hwmon.c
+++ b/drivers/platform/mips/cpu_hwmon.c
@@ -176,7 +176,7 @@ static int __init loongson_hwmon_init(void)
 
 	cpu_hwmon_dev = hwmon_device_register(NULL);
 	if (IS_ERR(cpu_hwmon_dev)) {
-		ret = -ENOMEM;
+		ret = PTR_ERR(cpu_hwmon_dev);
 		pr_err("hwmon_device_register fail!\n");
 		goto fail_hwmon_device_register;
 	}
-- 
2.1.0



^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] MIPS: Loongson: Fix return value of loongson_hwmon_init
  2019-11-04 13:33 [PATCH] MIPS: Loongson: Fix return value of loongson_hwmon_init Tiezhu Yang
@ 2019-11-04 19:06 ` Paul Burton
  0 siblings, 0 replies; 2+ messages in thread
From: Paul Burton @ 2019-11-04 19:06 UTC (permalink / raw)
  To: Tiezhu Yang
  Cc: Paul Burton, Ralf Baechle, James Hogan, Huacai Chen, Jiaxun Yang,
	linux-mips, linux-kernel, linux-mips

Hello,

Tiezhu Yang wrote:
> When call function hwmon_device_register failed, use the actual
> return value instead of always -ENOMEM.

Applied to mips-next.

> commit dece3c2a320b
> https://git.kernel.org/mips/c/dece3c2a320b
> 
> Fixes: 64f09aa967e1 ("MIPS: Loongson-3: Add CPU Hwmon platform driver")
> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
> Signed-off-by: Paul Burton <paulburton@kernel.org>

Thanks,
    Paul

[ This message was auto-generated; if you believe anything is incorrect
  then please email paulburton@kernel.org to report it. ]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, back to index

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-11-04 13:33 [PATCH] MIPS: Loongson: Fix return value of loongson_hwmon_init Tiezhu Yang
2019-11-04 19:06 ` Paul Burton

Linux-MIPS Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mips/0 linux-mips/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mips linux-mips/ https://lore.kernel.org/linux-mips \
		linux-mips@vger.kernel.org
	public-inbox-index linux-mips

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-mips


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git