Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp225056imu; Thu, 6 Dec 2018 23:23:50 -0800 (PST) X-Google-Smtp-Source: AFSGD/VrKpx8KRZ4i5GKIb/VWYqMM/ZhLxzrX28sd3L7DkRFWdHGw18iV/9r/pIXn+XHmFug9vSY X-Received: by 2002:a17:902:708b:: with SMTP id z11mr1104210plk.203.1544167430013; Thu, 06 Dec 2018 23:23:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544167429; cv=none; d=google.com; s=arc-20160816; b=xTym24wmOeEyxi46dEnVdBr8Kuzm9vvd0VRG3ioI8oBT9pSdWhTd9O0MqQjX8wWhEB BiBlayyLUqMUWnxvMCXd78vpDDNrJVsj6pRnpTORVpD1/jIA/jZIWdKURQZDhXChtvqX p9+QOgtEt2bIWipw2/rZ2etGw7q4zK+m9NnBzGVvoKaN0MDtCkKWFDg8kt17X/3CUqkx ElyX18DYbuqUlAAH63UVL76uAKbwbkGKnqOHwZKeDdwS6/h3lvxjYzqEluEh5GfapSa3 ZqCPVulCSktTRiOai3CT/a0kkNKLCFVxfCHQ5iFx/plkXGic9iNZSUecgDQk45qHuabr BZWw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=o6FmuEqhKyhfG0JIUB5hXRFnDBel+vQtOMb9JCDKPpE=; b=W4kvlg9uJGqH8qlHczGCAyrcaAZcZ/QaUZcNdGNrBKhj0QWE1mXhRM/Cem92zHpR03 0RESn58UaXlr9nkm0l6PjYVn8Hwdvxxm597NVFppSEDeTNWeGpsbFyr7hdn9Tcbi2HKs S4ukVHT+haMsOf4Q4N7ACqOUxTA57mQKk6+wpAlDLaBjQIMg989F/8K06SEFaiCNpvTd VKc5FAm06LG7KRMsVTt3Nn6mj8/ClIIkG67pAjp1uZvTUdD9AV1reHWvpsvwqP1TsWSn TLh32erf7jqBiqWGQQ1rp1X7VbrPeUdJIJLYpjadkpWZIQzr477WpJ5M6DzN+GlqOMSa BG2g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g8si2498421pli.50.2018.12.06.23.23.32; Thu, 06 Dec 2018 23:23:49 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725989AbeLGHQQ (ORCPT + 99 others); Fri, 7 Dec 2018 02:16:16 -0500 Received: from eddie.linux-mips.org ([148.251.95.138]:56226 "EHLO cvs.linux-mips.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725948AbeLGHQP (ORCPT ); Fri, 7 Dec 2018 02:16:15 -0500 Received: (from localhost user: 'ladis' uid#1021 fake: STDIN (ladis@eddie.linux-mips.org)) by eddie.linux-mips.org id S23990824AbeLGHPMpJmuU (ORCPT + 1 other); Fri, 7 Dec 2018 08:15:12 +0100 Date: Fri, 7 Dec 2018 08:15:10 +0100 From: Ladislav Michl To: Keerthy Cc: tony@atomide.com, lee.jones@linaro.org, sebastian.reichel@collabora.com, Christian.Hohnstaedt@wago.com, t-kristo@ti.com, linux-omap@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] tps65218: Use devm_regmap_add_irq_chip and clean up error path in probe Message-ID: <20181207071510.GA3465@lenoch> References: <1544143788-22606-1-git-send-email-j-keerthy@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1544143788-22606-1-git-send-email-j-keerthy@ti.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Dec 07, 2018 at 06:19:48AM +0530, Keerthy wrote: > Use devm_regmap_add_irq_chip and clean up error path in probe. > Hence clean up the probe error path and the remove function. > > Reported-by: Christian Hohnstaedt > Signed-off-by: Keerthy > --- > > Changes in v2: > > * Cleaned up remove function as well. v3: Remove remove function? :) > drivers/mfd/tps65218.c | 18 +++--------------- > 1 file changed, 3 insertions(+), 15 deletions(-) > > diff --git a/drivers/mfd/tps65218.c b/drivers/mfd/tps65218.c > index 910f569..d2d4e3a 100644 > --- a/drivers/mfd/tps65218.c > +++ b/drivers/mfd/tps65218.c > @@ -235,9 +235,9 @@ static int tps65218_probe(struct i2c_client *client, > > mutex_init(&tps->tps_lock); > > - ret = regmap_add_irq_chip(tps->regmap, tps->irq, > - IRQF_ONESHOT, 0, &tps65218_irq_chip, > - &tps->irq_data); > + ret = devm_regmap_add_irq_chip(&client->dev, tps->regmap, tps->irq, > + IRQF_ONESHOT, 0, &tps65218_irq_chip, > + &tps->irq_data); > if (ret < 0) > return ret; > > @@ -253,23 +253,11 @@ static int tps65218_probe(struct i2c_client *client, > ARRAY_SIZE(tps65218_cells), NULL, 0, > regmap_irq_get_domain(tps->irq_data)); > > - if (ret < 0) > - goto err_irq; > - > - return 0; > - > -err_irq: > - regmap_del_irq_chip(tps->irq, tps->irq_data); > - > return ret; > } > > static int tps65218_remove(struct i2c_client *client) > { > - struct tps65218 *tps = i2c_get_clientdata(client); > - > - regmap_del_irq_chip(tps->irq, tps->irq_data); > - > return 0; > } > > -- > 1.9.1