mirror of
https://github.com/torvalds/linux.git
synced 2026-05-29 17:43:52 +02:00
soc: aspeed: lpc: Fix impossible judgment condition
smatch error:
drivers/soc/aspeed/aspeed-lpc-snoop.c:169
aspeed_lpc_snoop_config_irq() warn: platform_get_irq() does not return zero
platform_get_irq() return non-zero IRQ number or negative error code,
change '!lpc_snoop->irq' to 'lpc_snoop->irq < 0' to fix this.
Fixes: 9f4f9ae81d ("drivers/misc: add Aspeed LPC snoop driver")
Signed-off-by: Su Hui <suhui@nfschina.com>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Link: https://lore.kernel.org/r/20231027020703.1231875-1-suhui@nfschina.com
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
This commit is contained in:
parent
e4f59f873c
commit
d9f0a97e85
|
|
@ -166,7 +166,7 @@ static int aspeed_lpc_snoop_config_irq(struct aspeed_lpc_snoop *lpc_snoop,
|
|||
int rc;
|
||||
|
||||
lpc_snoop->irq = platform_get_irq(pdev, 0);
|
||||
if (!lpc_snoop->irq)
|
||||
if (lpc_snoop->irq < 0)
|
||||
return -ENODEV;
|
||||
|
||||
rc = devm_request_irq(dev, lpc_snoop->irq,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user