From patchwork Tue Jun 23 02:51:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Andreas_F=C3=A4rber?= X-Patchwork-Id: 11619655 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 47F5B6C1 for ; Tue, 23 Jun 2020 03:03:39 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 20B6E20786 for ; Tue, 23 Jun 2020 03:03:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="FRpH+Afp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 20B6E20786 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=CNXM4YqDZvuzFh2QqcbcjOOcHgyb+6s8gMxidVWhRGk=; b=FRpH+AfpmAJcOTvEvJK6c5eR5 0l297SvoUmPPaEwi7WCunCIXx9RIzaH5BXdDbtB0oWXPnL3ssOEr1yRTKQkzRsH1QrwlFS1wiQub3 a2nfA4SF+WwUpzpOaHMlzpoQnIMfUKM+tJWsTe0NClhKTbd1BNFkP1fp+9SM7KSOHJ6m+UmAO3EsX fgZD0h4Df0z3GPpORw3EN+iNCl5Bu7RinDebQIkVzxYwoCy1XFB/xpkSHi+DssGYrRP00IhWC8GFX TZPnEt/9Ianv1TfZfURMh2y8AWLI5t/r4wynLyjWWVVGVQBQIcNUjX29X6rk+pSA2DfZN9Nf0V+hb cH93nuo5w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnZBf-0000KG-HA; Tue, 23 Jun 2020 03:01:27 +0000 Received: from mx2.suse.de ([195.135.220.15]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jnZ3S-0002aP-1R; Tue, 23 Jun 2020 02:52:59 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id 62E89B1A7; Tue, 23 Jun 2020 02:51:43 +0000 (UTC) From: =?utf-8?q?Andreas_F=C3=A4rber?= To: linux-realtek-soc@lists.infradead.org Subject: [PATCH v2 29/29] soc: realtek: chip: Adopt nvmem_cell_read_u8() helper Date: Tue, 23 Jun 2020 04:51:06 +0200 Message-Id: <20200623025106.31273-30-afaerber@suse.de> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200623025106.31273-1-afaerber@suse.de> References: <20200623025106.31273-1-afaerber@suse.de> MIME-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -2.3 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.3 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [195.135.220.15 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [195.135.220.15 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?b?SmFtZXMgVGFpIFvmiLTlv5fls7Bd?= , Edgar Lee , linux-kernel@vger.kernel.org, Srinivas Kandagatla , =?utf-8?b?U3Rhbmxl?= =?utf-8?b?eSBDaGFuZyBb5piM6IKy5b63XQ==?= , =?utf-8?q?Andreas_F=C3=A4rber?= , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Replace the local helper with the newly introduced official one. Cc: Srinivas Kandagatla Signed-off-by: Andreas Färber --- This could be squashed if the new API and this commit were to get merged in subsequent merge windows or with the help of a topic branch. v2: New drivers/soc/realtek/chip.c | 29 +---------------------------- 1 file changed, 1 insertion(+), 28 deletions(-) diff --git a/drivers/soc/realtek/chip.c b/drivers/soc/realtek/chip.c index bed028ce1b16..46e0d9063b5d 100644 --- a/drivers/soc/realtek/chip.c +++ b/drivers/soc/realtek/chip.c @@ -79,33 +79,6 @@ struct dhc_soc { const char *codename; }; -static int dhc_efuse_read_u8(struct device *dev, const char *cell_id, u8 *val) -{ - struct nvmem_cell *cell; - void *buf; - size_t len; - - cell = nvmem_cell_get(dev, cell_id); - if (IS_ERR(cell)) - return PTR_ERR(cell); - - buf = nvmem_cell_read(cell, &len); - if (IS_ERR(buf)) { - nvmem_cell_put(cell); - return PTR_ERR(buf); - } - if (len != sizeof(*val)) { - kfree(buf); - nvmem_cell_put(cell); - return -EINVAL; - } - memcpy(val, buf, 1); - kfree(buf); - nvmem_cell_put(cell); - - return 0; -} - static const char *default_name(struct device *dev, const struct dhc_soc *s) { return s->family; @@ -118,7 +91,7 @@ static const char *rtd1295_name(struct device *dev, const struct dhc_soc *s) int ret; u8 b; - ret = dhc_efuse_read_u8(dev, "efuse_package_id", &b); + ret = nvmem_cell_read_u8(dev, "efuse_package_id", &b); if (ret == -EPROBE_DEFER) return ERR_PTR(ret); else if (ret)