Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp3249991ybt; Mon, 22 Jun 2020 19:55:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz/4ZbiSXqV3jC39IH2u+Bn3IZsDDwiB21gV2EGrRrQfXlJxDVUaTuWuTvrpmDQA0JuoH+k X-Received: by 2002:a50:ee18:: with SMTP id g24mr20350939eds.370.1592880932860; Mon, 22 Jun 2020 19:55:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1592880932; cv=none; d=google.com; s=arc-20160816; b=UbgKxJKQlE9+Z32wh06ZDPXsdrXPcd5uXIXsa3pEcywfPMdBtDBB8ecunvWUEWJ+Vw JInrsEwUbgrr9WXP6v+wAku0YXR1n9N2vUxUBJhBZchL/Fd7Whaln7/8cLw8DVwba62W 788Q+QKvLVZIXe/OUpTwr0JPQhk2G3jY6IPpu3Dnlg8+PSU7v2tlbiS9lH+yQal2FpVS PBp/pLF/bpjnLsyAQcsL5GwRJ25z/SzqcW7Syj9nyxqVGhILLcT9ARFRhOpCR9/RhWHV pSdEzDRQ0m4atLzqB608L7QkcUTQFAfCtwXlXDj4mQRn0AR32RhszV+GqluqVbOIWvLn eI/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=Rm+7Uql7KEarqzmlgbfK5wvmPUyZ5uO9O09NcLqzNVE=; b=VajQINg9o4ocZZ6qgerLoYkN4AdlOLpJJI/mqhRHv7mD0K8929+M4sPJL0rNE7mZ5r tlH0YIO/nR9g8mExGrZ+0xvGul4egZRDtUWj1NAxmU87s4OAJyNRyYQivm+88Ta0Px84 0SdU9AM3GA/BYiRzEZcR6wRT0t8iWYB4+0o+1wxzMxfrl0T94d8T4ECUU+3m1xlqvzqV kX0bKL5pc+73XgrMQzdPEEi64mFU2i+t5Q2ICkRqiNwIjftcuq35YFsSgZUojC06EH7H bsY3HNuwfGRUybsqlXE6CZBdvo8hJdxFYQY8MMIZ4d1KW9QDleUa1o+m0LOHJsTcSWQX yFIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ds15si14429322ejc.14.2020.06.22.19.55.10; Mon, 22 Jun 2020 19:55:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731990AbgFWCwn (ORCPT + 99 others); Mon, 22 Jun 2020 22:52:43 -0400 Received: from mx2.suse.de ([195.135.220.15]:33040 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731985AbgFWCvo (ORCPT ); Mon, 22 Jun 2020 22:51:44 -0400 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=20F=C3=A4rber?= To: linux-realtek-soc@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, =?UTF-8?q?James=20Tai=20=5B=E6=88=B4=E5=BF=97=E5=B3=B0=5D?= , =?UTF-8?q?Stanley=20Chang=20=5B=E6=98=8C=E8=82=B2=E5=BE=B7=5D?= , Edgar Lee , =?UTF-8?q?Andreas=20F=C3=A4rber?= , Srinivas Kandagatla 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 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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) -- 2.26.2