Commit 4a4800e51be82814a091c2cd28341a34e0c1c1a0
Committed by
Greg Kroah-Hartman
1 parent
68e0943dd0
iio: adc: checking for NULL instead of IS_ERR() in probe
commit e94f62e79f7f63a68574ee5e76c19837ec12f3db upstream. mcb_request_mem() returns an ERR_PTR(), it doesn't return NULL. Fixes: 74aeac4da66f ('iio: adc: Add MEN 16z188 ADC driver') Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Jonathan Cameron <jic23@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Showing 1 changed file with 2 additions and 2 deletions Side-by-side Diff
drivers/iio/adc/men_z188_adc.c
... | ... | @@ -121,8 +121,8 @@ |
121 | 121 | indio_dev->num_channels = ARRAY_SIZE(z188_adc_iio_channels); |
122 | 122 | |
123 | 123 | mem = mcb_request_mem(dev, "z188-adc"); |
124 | - if (!mem) | |
125 | - return -ENOMEM; | |
124 | + if (IS_ERR(mem)) | |
125 | + return PTR_ERR(mem); | |
126 | 126 | |
127 | 127 | adc->base = ioremap(mem->start, resource_size(mem)); |
128 | 128 | if (adc->base == NULL) |