Skip to content

Commit 70513e1

Browse files
YueHaibingherbertx
authored andcommitted
crypto: aspeed - Fix check for platform_get_irq() errors
The platform_get_irq() function returns negative on error and positive non-zero values on success. It never returns zero, but if it did then treat that as a success. Also remove redundant dev_err() print as platform_get_irq() already prints an error. Fixes: 108713a ("crypto: aspeed - Add HACE hash driver") Signed-off-by: YueHaibing <yuehaibing@huawei.com> Reviewed-by: Neal Liu <neal_liu@aspeedtech.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent 4a20907 commit 70513e1

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

drivers/crypto/aspeed/aspeed-hace.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,8 @@ static int aspeed_hace_probe(struct platform_device *pdev)
130130

131131
/* Get irq number and register it */
132132
hace_dev->irq = platform_get_irq(pdev, 0);
133-
if (!hace_dev->irq) {
134-
dev_err(&pdev->dev, "Failed to get interrupt\n");
133+
if (hace_dev->irq < 0)
135134
return -ENXIO;
136-
}
137135

138136
rc = devm_request_irq(&pdev->dev, hace_dev->irq, aspeed_hace_irq, 0,
139137
dev_name(&pdev->dev), hace_dev);

0 commit comments

Comments
 (0)