From patchwork Wed Oct 3 17:47:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 148068 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp6774053lji; Wed, 3 Oct 2018 10:49:32 -0700 (PDT) X-Google-Smtp-Source: ACcGV62P7+zVv7DOxlotJLmDxyBl1knh9Le6r182FSmcPHICMI8OsT4YhdDdPYtPQvWZhVSygtQt X-Received: by 2002:a17:902:6b47:: with SMTP id g7-v6mr2795611plt.128.1538588972023; Wed, 03 Oct 2018 10:49:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538588972; cv=none; d=google.com; s=arc-20160816; b=U7FszV2qIoTnvqk1hq0j0lDSM9ZbtSzdlmEtCHnbbeIkDx8qMDZ3CwJ3stzCjUQWwl kvVvKyQV1LMTbKH8sdhDx+pzZ6znuje4e1j5jWzGwnP6tNZzoVgXi4jdizRzM6Xnk1JC HqEDGEngQKAOZXxXLbe9hLcYvd7Qo6XSJrFhp3oP1kTP6trshf2j6g1Wmt2ATTau+qiP BdsZpLSZVQE74t4T9EDSfqdMqtRYDDqK/qtEQK1n4nY0BdE+wCHOa/KOgeg0XF+PBiKZ yx7bC9XCNF+0i8eOnMPfURqOOueJPUUS7h2vxUK9PYu3bYRHUlPNYgMEzXQNhFWI/FHX o1tQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=1pCLnfMcmeguDpAo592wfBUt9AqVNERm1HQcztKrjVI=; b=U6zLEUf95sOXnDelJuf7Png0ukZlZ8lH3upLFfSgumAM2feUAnklhRp9lA8awcd4Qb RDOpDHET5rUFxKCVRCMjddXjDzXjdwKj09e1teG2+2PQf2G8pm6JyftCAXa/xeHopsD+ fRN36bt8yoqPwVOzeBX/s+tiR7qhI85fftnkYNFJ5Rt9dJPD7xwsdrXFBbjWLD3t4+mS i+hNXF1lxLYofYgRG0VJWG2YTrH85uF26HDkTNrNP5WTv9JbVvgUKbbRCxeN+8mZKoBQ QiBgS5yhxpZtjpDXOy3wbm/qBa19Rdxl1xrMclwRrCbW1crKB2PxpO/FK5EOUvvr6FuP Qvlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=eg5ZoEkN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h34-v6si2374586pld.49.2018.10.03.10.49.31; Wed, 03 Oct 2018 10:49:32 -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; dkim=pass header.i=@linaro.org header.s=google header.b=eg5ZoEkN; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727234AbeJDAix (ORCPT + 32 others); Wed, 3 Oct 2018 20:38:53 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:35750 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726871AbeJDAix (ORCPT ); Wed, 3 Oct 2018 20:38:53 -0400 Received: by mail-wr1-f67.google.com with SMTP id w5-v6so7115383wrt.2 for ; Wed, 03 Oct 2018 10:49:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=1pCLnfMcmeguDpAo592wfBUt9AqVNERm1HQcztKrjVI=; b=eg5ZoEkNhKqEu0Vd/RcXCKXwYhJa/wxk50j8Y2ZE3L/4jO6F5xZK4FHeVTSAEHorSe Ldw1CN9VjSkq9FKzHnMsFpabZ4LWqashNbYvwdsVDWa3yXqcsCC6HOIe50dKuGhUAPR2 gvLJUk7dG0ICiQOne6picj9A5ycQj+eKm89bc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=1pCLnfMcmeguDpAo592wfBUt9AqVNERm1HQcztKrjVI=; b=LzxyX6azcNrITH8/cmHq2k/pTzWJkqzBm+JSf1Dg3sYCTFFFh9+YPesZwdx6FREvLz pdGH99xdfnh06LzTDOuCLRjIkpopjDFHnKMpsV84Odg5RaWZxB0zWDdPqtC3tDeVogNV t9ybHCzOYYGtytmcih1trzY7cvhz7frH6JxWMyl03S0k3u8x1O9iy0obCIZtQ+knTIil hEeNoyiOxcYCuFBMwVU7Qz9R55Ugk+mCLiuXYLE5GPziGc6ZSJnz3obzAs/LbZxB5rQY UXRjqiPYm884LR6BY509rXDWKNJIbLYhKLgoSnCXN3sWNFbx3fBnsMhVzLn8soxg+4x+ qmSQ== X-Gm-Message-State: ABuFfoixCOe0rkOrImCPQcoIm/wsgkm2poYS1yVXmcv426+B1yPb32Cp 48cRoCZrsGMtChHzrjbjZpSxWA== X-Received: by 2002:adf:9b19:: with SMTP id b25-v6mr2198149wrc.35.1538588967237; Wed, 03 Oct 2018 10:49:27 -0700 (PDT) Received: from localhost.localdomain (cpc90716-aztw32-2-0-cust92.18-1.cable.virginm.net. [86.26.100.93]) by smtp.gmail.com with ESMTPSA id a105-v6sm4052005wrc.23.2018.10.03.10.49.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 03 Oct 2018 10:49:26 -0700 (PDT) From: Srinivas Kandagatla To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, robh@kernel.org, Srinivas Kandagatla Subject: [PATCH] nvmem: Convert to using %pOFn instead of device_node.name Date: Wed, 3 Oct 2018 18:47:04 +0100 Message-Id: <20181003174704.7067-1-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.19.0 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rob Herring In preparation to remove the node name pointer from struct device_node, convert printf users to use the %pOFn format specifier. Cc: Srinivas Kandagatla Signed-off-by: Rob Herring [srinivas: rebased on top of next] Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.19.0 diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index cc815bb2eebd..b4c09bc20b67 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -298,6 +298,7 @@ static void nvmem_cell_drop(struct nvmem_cell *cell) mutex_lock(&nvmem_mutex); list_del(&cell->node); mutex_unlock(&nvmem_mutex); + kfree(cell->name); kfree(cell); } @@ -547,7 +548,7 @@ static int nvmem_add_cells_from_of(struct nvmem_device *nvmem) cell->nvmem = nvmem; cell->offset = be32_to_cpup(addr++); cell->bytes = be32_to_cpup(addr); - cell->name = child->name; + cell->name = kasprintf(GFP_KERNEL, "%pOFn", child); addr = of_get_property(child, "bits", &len); if (addr && len == (2 * sizeof(u32))) { @@ -564,6 +565,7 @@ static int nvmem_add_cells_from_of(struct nvmem_device *nvmem) dev_err(dev, "cell %s unaligned to nvmem stride %d\n", cell->name, nvmem->stride); /* Cells already added will be freed later. */ + kfree(cell->name); kfree(cell); return -EINVAL; }