Message ID | 20220718194258.181738-1-ukleinek@debian.org (mailing list archive) |
---|---|
State | Changes Requested |
Headers | show |
Series | [v2,1/3] iio: humidity: dht11: Don't warn on memory allocation failure | expand |
On Mon, Jul 18, 2022 at 9:50 PM Uwe Kleine-König <ukleinek@debian.org> wrote: > > The kernel is already quite noisy if a memory allocation fails. So it's > the usual policy to not add another message on the driver level. > > Drop the error message accordingly. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> > Signed-off-by: Uwe Kleine-König <ukleinek@debian.org> > --- > Unchanged since (implicit) v1 > > drivers/iio/humidity/dht11.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/iio/humidity/dht11.c b/drivers/iio/humidity/dht11.c > index c97e25448772..891b6bf0b4ca 100644 > --- a/drivers/iio/humidity/dht11.c > +++ b/drivers/iio/humidity/dht11.c > @@ -295,10 +295,8 @@ static int dht11_probe(struct platform_device *pdev) > struct iio_dev *iio; > > iio = devm_iio_device_alloc(dev, sizeof(*dht11)); > - if (!iio) { > - dev_err(dev, "Failed to allocate IIO device\n"); > + if (!iio) > return -ENOMEM; > - } > > dht11 = iio_priv(iio); > dht11->dev = dev; > > base-commit: f2906aa863381afb0015a9eb7fefad885d4e5a56 > -- > 2.36.1 >
diff --git a/drivers/iio/humidity/dht11.c b/drivers/iio/humidity/dht11.c index c97e25448772..891b6bf0b4ca 100644 --- a/drivers/iio/humidity/dht11.c +++ b/drivers/iio/humidity/dht11.c @@ -295,10 +295,8 @@ static int dht11_probe(struct platform_device *pdev) struct iio_dev *iio; iio = devm_iio_device_alloc(dev, sizeof(*dht11)); - if (!iio) { - dev_err(dev, "Failed to allocate IIO device\n"); + if (!iio) return -ENOMEM; - } dht11 = iio_priv(iio); dht11->dev = dev;
The kernel is already quite noisy if a memory allocation fails. So it's the usual policy to not add another message on the driver level. Drop the error message accordingly. Signed-off-by: Uwe Kleine-König <ukleinek@debian.org> --- Unchanged since (implicit) v1 drivers/iio/humidity/dht11.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) base-commit: f2906aa863381afb0015a9eb7fefad885d4e5a56