From patchwork Mon Feb 12 22:47:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 872486 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-rtc-owner@vger.kernel.org; receiver=) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 3zgLcq1m6Sz9t2l for ; Tue, 13 Feb 2018 09:56:11 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933064AbeBLWzu (ORCPT ); Mon, 12 Feb 2018 17:55:50 -0500 Received: from mail.free-electrons.com ([62.4.15.54]:37553 "EHLO mail.free-electrons.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932691AbeBLWsg (ORCPT ); Mon, 12 Feb 2018 17:48:36 -0500 Received: by mail.free-electrons.com (Postfix, from userid 110) id A585B207F7; Mon, 12 Feb 2018 23:48:34 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.free-electrons.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT, URIBL_BLOCKED shortcircuit=ham autolearn=disabled version=3.4.0 Received: from localhost (unknown [88.191.26.124]) by mail.free-electrons.com (Postfix) with ESMTPSA id 7106F20804; Mon, 12 Feb 2018 23:48:08 +0100 (CET) From: Alexandre Belloni To: linux-rtc@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Alexandre Belloni Subject: [PATCH 15/45] rtc: pcf85363: call rtc_nvmem_register() Date: Mon, 12 Feb 2018 23:47:29 +0100 Message-Id: <20180212224759.15999-16-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180212224759.15999-1-alexandre.belloni@bootlin.com> References: <20180212224759.15999-1-alexandre.belloni@bootlin.com> Sender: linux-rtc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rtc@vger.kernel.org Call rtc_nvmem_register instead of letting the core do it and stop using the nvmem_config member of struct rtc_device. Signed-off-by: Alexandre Belloni --- drivers/rtc/rtc-pcf85363.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/rtc/rtc-pcf85363.c b/drivers/rtc/rtc-pcf85363.c index ea04e9f0930b..a1fe833d2431 100644 --- a/drivers/rtc/rtc-pcf85363.c +++ b/drivers/rtc/rtc-pcf85363.c @@ -164,6 +164,7 @@ static int pcf85363_probe(struct i2c_client *client, const struct i2c_device_id *id) { struct pcf85363 *pcf85363; + int ret; if (!i2c_check_functionality(client->adapter, I2C_FUNC_I2C)) return -ENODEV; @@ -193,10 +194,13 @@ static int pcf85363_probe(struct i2c_client *client, pcf85363->nvmem_cfg.reg_read = pcf85363_nvram_read; pcf85363->nvmem_cfg.reg_write = pcf85363_nvram_write; pcf85363->nvmem_cfg.priv = pcf85363; - pcf85363->rtc->nvmem_config = &pcf85363->nvmem_cfg; pcf85363->rtc->ops = &rtc_ops; - return rtc_register_device(pcf85363->rtc); + ret = rtc_register_device(pcf85363->rtc); + + rtc_nvmem_register(pcf85363->rtc, &pcf85363->nvmem_cfg); + + return ret; } static const struct of_device_id dev_ids[] = {