Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp2852146ybl; Thu, 29 Aug 2019 13:59:14 -0700 (PDT) X-Google-Smtp-Source: APXvYqxw2iPWZ6OHuakb1UbfyVxjUqafTAHu7NCmqWL8dMmYC1torGBHXTZU7nhUJJGs89HdwRiA X-Received: by 2002:a63:6904:: with SMTP id e4mr5944432pgc.321.1567112353928; Thu, 29 Aug 2019 13:59:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567112353; cv=none; d=google.com; s=arc-20160816; b=eYRJTHLpt73ZACHvKFFwAfqnQpH1idk2dn4sy5h24lD0/01NTbjBd2mxQe05zcLQIX 3rZlLYiZ3hIOsGIWdKvRS+l4RjNxi47lFgf0UxEiScywKBTxnb7+qdVgt5vC1kXCQCU5 jRFV6T1dQ9+kQtVmajEkV6c1DkTmDjdtKITIT0hsGrtLxlOdZGQXxJExSF0JXmkL9jdb EmbsLLTaG4J234iOshS9aad2N1RUSqb29msipoAu53lOFAPvCdwg6Hc1dUUGrGycWCpz kQXBbCVQrkGCf3frDik1Fqgx7QheCE6kov/HpnvndkjScB0cTNpxjAVGJtV3spt7LVcm dHAg== 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=UWLnOdkbE08QHdDFjtXw2aZS+7qmPUItP+q7gVb7PNs=; b=WGJ9Qq0ux/5epcH0VvOZvHTbJgOjvd04051hThMrGUfb6Wzx85JHYWgaHiQO1IgnAC sV3rI5e5kJv2DCn+nBGQv+S4ueQtk5cNkKHo8v6rII53OZH5tL3eK2eDSMb3n8V94fNO 7z/vD+AuwzjJgk2u1MuIruZz2kHOWVXMeit/3fbPcthqaXNW1gk+J79L0u7eo3heB0bo /yB6ewnOk5g/rmU4cIwBmtwrWnp4e/SHJOy/JkfqqzcPj1SHRT4w5HuuyTUWUFHq7fNm lKVlUow35Q2YS4zfUf/iigu7qcVpa365ifpOtBoIkn3JChYV7k6qMvqH4OoD/UG2+kv7 J+bg== 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 g11si3048778plm.230.2019.08.29.13.58.58; Thu, 29 Aug 2019 13:59:13 -0700 (PDT) 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 S1728213AbfH2U6C (ORCPT + 99 others); Thu, 29 Aug 2019 16:58:02 -0400 Received: from relay1-d.mail.gandi.net ([217.70.183.193]:42777 "EHLO relay1-d.mail.gandi.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726944AbfH2U6B (ORCPT ); Thu, 29 Aug 2019 16:58:01 -0400 X-Originating-IP: 90.65.161.137 Received: from localhost (lfbn-1-1545-137.w90-65.abo.wanadoo.fr [90.65.161.137]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id E216A240010; Thu, 29 Aug 2019 20:57:58 +0000 (UTC) Date: Thu, 29 Aug 2019 22:57:52 +0200 From: Alexandre Belloni To: Wolfram Sang Cc: linux-i2c@vger.kernel.org, Chanwoo Choi , Krzysztof Kozlowski , Bartlomiej Zolnierkiewicz , Alessandro Zummo , linux-kernel@vger.kernel.org, linux-rtc@vger.kernel.org Subject: Re: [PATCH 1/2] rtc: max77686: convert to devm_i2c_new_dummy_device() Message-ID: <20190829205752.GL21922@piout.net> References: <20190820154239.8230-1-wsa+renesas@sang-engineering.com> <20190820154239.8230-2-wsa+renesas@sang-engineering.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190820154239.8230-2-wsa+renesas@sang-engineering.com> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 20/08/2019 17:42:37+0200, Wolfram Sang wrote: > I was about to simplify the call to i2c_unregister_device() when I > realized that converting to devm_i2c_new_dummy_device() will simplify > the driver a lot. So I took this approach. > > Signed-off-by: Wolfram Sang > --- > Build tested only, buildbot is happy, too. > > Please apply to your tree. > I'm confused because I already applied: https://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux.git/commit/?h=rtc-next&id=7150710f3084de8d35ce3221eeae2caee8813f92 > drivers/rtc/rtc-max77686.c | 17 ++++------------- > 1 file changed, 4 insertions(+), 13 deletions(-) > > diff --git a/drivers/rtc/rtc-max77686.c b/drivers/rtc/rtc-max77686.c > index d04fd1024697..4027b33034dc 100644 > --- a/drivers/rtc/rtc-max77686.c > +++ b/drivers/rtc/rtc-max77686.c > @@ -693,8 +693,8 @@ static int max77686_init_rtc_regmap(struct max77686_rtc_info *info) > goto add_rtc_irq; > } > > - info->rtc = i2c_new_dummy_device(parent_i2c->adapter, > - info->drv_data->rtc_i2c_addr); > + info->rtc = devm_i2c_new_dummy_device(info->dev, parent_i2c->adapter, > + info->drv_data->rtc_i2c_addr); > if (IS_ERR(info->rtc)) { > dev_err(info->dev, "Failed to allocate I2C device for RTC\n"); > return PTR_ERR(info->rtc); > @@ -705,7 +705,7 @@ static int max77686_init_rtc_regmap(struct max77686_rtc_info *info) > if (IS_ERR(info->rtc_regmap)) { > ret = PTR_ERR(info->rtc_regmap); > dev_err(info->dev, "Failed to allocate RTC regmap: %d\n", ret); > - goto err_unregister_i2c; > + return ret; > } > > add_rtc_irq: > @@ -715,15 +715,10 @@ static int max77686_init_rtc_regmap(struct max77686_rtc_info *info) > &info->rtc_irq_data); > if (ret < 0) { > dev_err(info->dev, "Failed to add RTC irq chip: %d\n", ret); > - goto err_unregister_i2c; > + return ret; > } > > return 0; > - > -err_unregister_i2c: > - if (info->rtc) > - i2c_unregister_device(info->rtc); > - return ret; > } > > static int max77686_rtc_probe(struct platform_device *pdev) > @@ -786,8 +781,6 @@ static int max77686_rtc_probe(struct platform_device *pdev) > > err_rtc: > regmap_del_irq_chip(info->rtc_irq, info->rtc_irq_data); > - if (info->rtc) > - i2c_unregister_device(info->rtc); > > return ret; > } > @@ -798,8 +791,6 @@ static int max77686_rtc_remove(struct platform_device *pdev) > > free_irq(info->virq, info); > regmap_del_irq_chip(info->rtc_irq, info->rtc_irq_data); > - if (info->rtc) > - i2c_unregister_device(info->rtc); > > return 0; > } > -- > 2.20.1 > -- Alexandre Belloni, Bootlin Embedded Linux and Kernel engineering https://bootlin.com