diff options
author | Fabio Estevam <fabio.estevam@freescale.com> | 2013-01-08 07:45:04 -0500 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2013-01-08 12:58:32 -0500 |
commit | 324a7fb02b9e7a226916e3593f756cd85312bae8 (patch) | |
tree | 185b24beeda133f8ace4728476eb63fcdb3335ed /sound/soc/mxs | |
parent | 4498a3cae5012979bbf3be2064c5ca00fe29109b (diff) |
ASoC: mxs-saif: Use a signed integer for error value
saif->id and saif->master_id are unsigned, so they can not be negative.
Fix the following warning when building with W=1 option:
sound/soc/mxs/mxs-saif.c: In function 'mxs_saif_probe':
sound/soc/mxs/mxs-saif.c:676:2: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
sound/soc/mxs/mxs-saif.c:688:3: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
sound/soc/mxs/mxs-saif.c:692:2: warning: comparison of unsigned expression < 0 is always false [-Wtype-limits]
Use a signed variable 'ret' to handle the error values.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/mxs')
-rw-r--r-- | sound/soc/mxs/mxs-saif.c | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/sound/soc/mxs/mxs-saif.c b/sound/soc/mxs/mxs-saif.c index 752675da0658..e70e6c844f96 100644 --- a/sound/soc/mxs/mxs-saif.c +++ b/sound/soc/mxs/mxs-saif.c | |||
@@ -672,9 +672,12 @@ static int mxs_saif_probe(struct platform_device *pdev) | |||
672 | if (!saif) | 672 | if (!saif) |
673 | return -ENOMEM; | 673 | return -ENOMEM; |
674 | 674 | ||
675 | saif->id = of_alias_get_id(np, "saif"); | 675 | ret = of_alias_get_id(np, "saif"); |
676 | if (saif->id < 0) | 676 | if (ret < 0) |
677 | return saif->id; | 677 | return ret; |
678 | else | ||
679 | saif->id = ret; | ||
680 | |||
678 | /* | 681 | /* |
679 | * If there is no "fsl,saif-master" phandle, it's a saif | 682 | * If there is no "fsl,saif-master" phandle, it's a saif |
680 | * master. Otherwise, it's a slave and its phandle points | 683 | * master. Otherwise, it's a slave and its phandle points |
@@ -684,12 +687,14 @@ static int mxs_saif_probe(struct platform_device *pdev) | |||
684 | if (!master) { | 687 | if (!master) { |
685 | saif->master_id = saif->id; | 688 | saif->master_id = saif->id; |
686 | } else { | 689 | } else { |
687 | saif->master_id = of_alias_get_id(master, "saif"); | 690 | ret = of_alias_get_id(master, "saif"); |
688 | if (saif->master_id < 0) | 691 | if (ret < 0) |
689 | return saif->master_id; | 692 | return ret; |
693 | else | ||
694 | saif->master_id = ret; | ||
690 | } | 695 | } |
691 | 696 | ||
692 | if (saif->master_id < 0 || saif->master_id >= ARRAY_SIZE(mxs_saif)) { | 697 | if (saif->master_id >= ARRAY_SIZE(mxs_saif)) { |
693 | dev_err(&pdev->dev, "get wrong master id\n"); | 698 | dev_err(&pdev->dev, "get wrong master id\n"); |
694 | return -EINVAL; | 699 | return -EINVAL; |
695 | } | 700 | } |