Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753065AbdDLJmS (ORCPT ); Wed, 12 Apr 2017 05:42:18 -0400 Received: from mail1.hce-engineering.com ([104.233.86.154]:54541 "EHLO mail1.hce-engineering.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751106AbdDLJmP (ORCPT ); Wed, 12 Apr 2017 05:42:15 -0400 X-Greylist: delayed 1377 seconds by postgrey-1.27 at vger.kernel.org; Wed, 12 Apr 2017 05:42:15 EDT To: Dan Carpenter , linux-kernel@vger.kernel.org, Rodolfo Giometti References: <20170412083321.GC3250@mwanda> Cc: kernel-janitors@vger.kernel.org, Andrew Morton From: Rodolfo Giometti Message-ID: Date: Wed, 12 Apr 2017 11:18:56 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <20170412083321.GC3250@mwanda> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 93.69.95.35 X-SA-Exim-Mail-From: giometti@enneenne.com Subject: Re: [PATCH] c2port: checking for NULL instead of IS_ERR() X-SA-Exim-Version: 4.2.1 (built Mon, 26 Dec 2011 16:24:06 +0000) X-SA-Exim-Scanned: Yes (on hce1.hce-engineering.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1355 Lines: 34 On 04/12/17 10:33, Dan Carpenter wrote: > c2port_device_register() never returns NULL, it uses error pointers. > > Fixes: 65131cd52b9e ("c2port: add c2port support for Eurotech Duramar 2150") > Signed-off-by: Dan Carpenter Acked-by: Rodolfo Giometti > diff --git a/drivers/misc/c2port/c2port-duramar2150.c b/drivers/misc/c2port/c2port-duramar2150.c > index 5484301d57d9..3dc61ea7dc64 100644 > --- a/drivers/misc/c2port/c2port-duramar2150.c > +++ b/drivers/misc/c2port/c2port-duramar2150.c > @@ -129,8 +129,8 @@ static int __init duramar2150_c2port_init(void) > > duramar2150_c2port_dev = c2port_device_register("uc", > &duramar2150_c2port_ops, NULL); > - if (!duramar2150_c2port_dev) { > - ret = -ENODEV; > + if (IS_ERR(duramar2150_c2port_dev)) { > + ret = PTR_ERR(duramar2150_c2port_dev); > goto free_region; > } > > -- HCE Engineering e-mail: giometti@hce-engineering.com GNU/Linux Solutions giometti@enneenne.com Linux Device Driver giometti@linux.it Embedded Systems phone: +39 349 2432127 UNIX programming skype: rodolfo.giometti Cosino Project - the quick prototyping embedded system - www.cosino.io Freelance ICT Italia - Consulente ICT Italia - www.consulenti-ict.it