[v1,1/1] extcon: intel-mrfld: Don't shadow error from devm_extcon_dev_allocate()

Message ID 20231222161854.2955859-1-andriy.shevchenko@linux.intel.com
State New
Headers
Series [v1,1/1] extcon: intel-mrfld: Don't shadow error from devm_extcon_dev_allocate() |

Commit Message

Andy Shevchenko Dec. 22, 2023, 4:18 p.m. UTC
  Don't shadow error from devm_extcon_dev_allocate() and return it as is.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/extcon/extcon-intel-mrfld.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Andy Shevchenko Feb. 8, 2024, 7:24 p.m. UTC | #1
On Fri, Dec 22, 2023 at 06:18:54PM +0200, Andy Shevchenko wrote:
> Don't shadow error from devm_extcon_dev_allocate() and return it as is.

Any comment on this?
  
Andy Shevchenko Feb. 22, 2024, 1:17 p.m. UTC | #2
On Thu, Feb 08, 2024 at 09:24:58PM +0200, Andy Shevchenko wrote:
> On Fri, Dec 22, 2023 at 06:18:54PM +0200, Andy Shevchenko wrote:
> > Don't shadow error from devm_extcon_dev_allocate() and return it as is.
> 
> Any comment on this?

Here is another one, can it be applied as well?
  
Chanwoo Choi Feb. 23, 2024, 7:43 a.m. UTC | #3
> -----Original Message-----
> From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Sent: Thursday, February 22, 2024 10:18 PM
> To: linux-kernel@vger.kernel.org
> Cc: MyungJoo Ham <myungjoo.ham@samsung.com>; Chanwoo Choi
> <cw00.choi@samsung.com>
> Subject: Re: [PATCH v1 1/1] extcon: intel-mrfld: Don't shadow error from
> devm_extcon_dev_allocate()
> 
> On Thu, Feb 08, 2024 at 09:24:58PM +0200, Andy Shevchenko wrote:
> > On Fri, Dec 22, 2023 at 06:18:54PM +0200, Andy Shevchenko wrote:
> > > Don't shadow error from devm_extcon_dev_allocate() and return it as
is.
> >
> > Any comment on this?
> 
> Here is another one, can it be applied as well?


Applied it. Thanks.

Best Regards,
Chanwoo Choi
  
Andy Shevchenko Feb. 23, 2024, 2:32 p.m. UTC | #4
On Fri, Feb 23, 2024 at 04:43:15PM +0900, Chanwoo Choi wrote:
> > From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> > Sent: Thursday, February 22, 2024 10:18 PM
> > On Thu, Feb 08, 2024 at 09:24:58PM +0200, Andy Shevchenko wrote:

..

> > Here is another one, can it be applied as well?
> 
> Applied it. Thanks.

Thank you!
  

Patch

diff --git a/drivers/extcon/extcon-intel-mrfld.c b/drivers/extcon/extcon-intel-mrfld.c
index 59cc3391bac7..2ee738f844ab 100644
--- a/drivers/extcon/extcon-intel-mrfld.c
+++ b/drivers/extcon/extcon-intel-mrfld.c
@@ -247,7 +247,7 @@  static int mrfld_extcon_probe(struct platform_device *pdev)
 
 	data->edev = devm_extcon_dev_allocate(dev, mrfld_extcon_cable);
 	if (IS_ERR(data->edev))
-		return -ENOMEM;
+		return PTR_ERR(data->edev);
 
 	ret = devm_extcon_dev_register(dev, data->edev);
 	if (ret < 0) {