Skip to content

Commit

Permalink
ASoC: sh: FSI:: don't check platform_get_irq's return value against zero
Browse files Browse the repository at this point in the history
platform_get_irq returns -ENXIO on failure, so !irq was probably
always true.  Better use (int)irq <= 0.  Note that a return value of
zero is still handled as error even though this could mean irq0.

This is a followup to 305b322 that
changed the return value of platform_get_irq from 0 to -ENXIO on error.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
  • Loading branch information
Uwe Kleine-König authored and Mark Brown committed Dec 22, 2009
1 parent 48c03ce commit b6aa179
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/soc/sh/fsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ static int fsi_probe(struct platform_device *pdev)

res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
irq = platform_get_irq(pdev, 0);
if (!res || !irq) {
if (!res || (int)irq <= 0) {
dev_err(&pdev->dev, "Not enough FSI platform resources.\n");
ret = -ENODEV;
goto exit;
Expand Down

0 comments on commit b6aa179

Please sign in to comment.