Message ID | 1403258352-8210-1-git-send-email-sachin.kamat@samsung.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 0e0327f2ab722e9e1e55c225cb86e1b02336ec96 |
Headers | show |
On 6/20/2014 3:28 PM, Sachin Kamat wrote: > Let memory subsystem handle the error logging. > > Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com> > --- > sound/soc/codecs/cs4270.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/sound/soc/codecs/cs4270.c b/sound/soc/codecs/cs4270.c > index 9947a9583679..e6d4ff9fd992 100644 > --- a/sound/soc/codecs/cs4270.c > +++ b/sound/soc/codecs/cs4270.c > @@ -664,10 +664,8 @@ static int cs4270_i2c_probe(struct i2c_client *i2c_client, > > cs4270 = devm_kzalloc(&i2c_client->dev, sizeof(struct cs4270_private), > GFP_KERNEL); > - if (!cs4270) { > - dev_err(&i2c_client->dev, "could not allocate codec\n"); You are just removing a information which are required in error condition. In my view it should be here.. ~Rajeev > + if (!cs4270) > return -ENOMEM; > - } > > /* get the power supply regulators */ > for (i = 0; i < ARRAY_SIZE(supply_names); i++) >
On 06/20/2014 01:04 PM, Rajeev kumar wrote: > On 6/20/2014 3:28 PM, Sachin Kamat wrote: >> Let memory subsystem handle the error logging. >> >> Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com> >> --- >> sound/soc/codecs/cs4270.c | 4 +--- >> 1 file changed, 1 insertion(+), 3 deletions(-) >> >> diff --git a/sound/soc/codecs/cs4270.c b/sound/soc/codecs/cs4270.c >> index 9947a9583679..e6d4ff9fd992 100644 >> --- a/sound/soc/codecs/cs4270.c >> +++ b/sound/soc/codecs/cs4270.c >> @@ -664,10 +664,8 @@ static int cs4270_i2c_probe(struct i2c_client >> *i2c_client, >> >> cs4270 = devm_kzalloc(&i2c_client->dev, sizeof(struct cs4270_private), >> GFP_KERNEL); >> - if (!cs4270) { >> - dev_err(&i2c_client->dev, "could not allocate codec\n"); > > You are just removing a information which are required in error condition. > In my view it should be here.. devm_kzalloc already prints a error message when the allocation fails.
> On Jun 20, 2014, at 5:03 AM, "Sachin Kamat" <sachin.kamat@samsung.com> wrote: > > Let memory subsystem handle the error logging. > > Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com> > --- > sound/soc/codecs/cs4270.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/sound/soc/codecs/cs4270.c b/sound/soc/codecs/cs4270.c > index 9947a9583679..e6d4ff9fd992 100644 > --- a/sound/soc/codecs/cs4270.c > +++ b/sound/soc/codecs/cs4270.c > @@ -664,10 +664,8 @@ static int cs4270_i2c_probe(struct i2c_client *i2c_client, > > cs4270 = devm_kzalloc(&i2c_client->dev, sizeof(struct cs4270_private), > GFP_KERNEL); > - if (!cs4270) { > - dev_err(&i2c_client->dev, "could not allocate codec\n"); > + if (!cs4270) > return -ENOMEM; > - } > > /* get the power supply regulators */ > for (i = 0; i < ARRAY_SIZE(supply_names); i++) > -- > 1.7.9.5 > > _______________________________________________ > Alsa-devel mailing list > Alsa-devel@alsa-project.org > http://mailman.alsa-project.org/mailman/listinfo/alsa-devel Please CC the driver maintainers. Acked-by: Paul Handrigan <Paul.Handrigan@cirrus.com>
diff --git a/sound/soc/codecs/cs4270.c b/sound/soc/codecs/cs4270.c index 9947a9583679..e6d4ff9fd992 100644 --- a/sound/soc/codecs/cs4270.c +++ b/sound/soc/codecs/cs4270.c @@ -664,10 +664,8 @@ static int cs4270_i2c_probe(struct i2c_client *i2c_client, cs4270 = devm_kzalloc(&i2c_client->dev, sizeof(struct cs4270_private), GFP_KERNEL); - if (!cs4270) { - dev_err(&i2c_client->dev, "could not allocate codec\n"); + if (!cs4270) return -ENOMEM; - } /* get the power supply regulators */ for (i = 0; i < ARRAY_SIZE(supply_names); i++)
Let memory subsystem handle the error logging. Signed-off-by: Sachin Kamat <sachin.kamat@samsung.com> --- sound/soc/codecs/cs4270.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)