From patchwork Tue Aug 28 01:52:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 145263 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp609681ljw; Mon, 27 Aug 2018 18:55:06 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaU7LOqkf2vKXBDcT4XFdIIQp/mE9HdoYrz2p+4/u57v1WoteanUQZSi7ZZcD5fSLRkEfPU X-Received: by 2002:a17:902:6b83:: with SMTP id p3-v6mr15502953plk.133.1535421306808; Mon, 27 Aug 2018 18:55:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535421306; cv=none; d=google.com; s=arc-20160816; b=tFV4alTvDJXws+FMhHYyxcuKBbVOF6EEVgD9+F08u2OQdXqUac9F7626VX01Krt7Xk J1+EnCDiLYNgJrziclWe0blLfqC2CA+7A1ic8KEgRf9wRlgj9OSd4ZY8+rBoaUuKICPN ASlXFH4tFJ7CVt0M6ufPpmEPVJZCEuVHpFVcLO5dU37nfymcqvTyFOBYOjkJ/O+lyTmb 66YvnIk0nNnfz17W2VfKY6vi0zWLGzuTKngxqBr5MCR01S0cCHTVNF1hv9caaThYwSpH +LCdOn2igfmK/SJguCgzX5xhOb6b6L6D9JJV0+LkrJ+YoLfBjmgo3fpPnJ4HYv05k3fA DIMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=Rh6W76aERtj34AivYjBtIfo6EjHUyukF1dZUI0dMekc=; b=GeJkEpOczggLKH9wiLBUXzH3nHsIKpyXLaWWyCSymiRZJlmHwRb4KIjzhS1GwJfnc/ DvOhn7yJ35+X6pzuIrTEf7Q/DLxiwX9xOhDQzc6fCUr1HKAlp0YYR8qj9t81Zhb33cMM KCdOYlEx5T0k3WdNc8o/6L9fYbKPSb5H0mo07r+UjsWjtM2a4QLBry/JBnNre3y0w9JP UGnoTh19LjECYTLs+ZhbIfDmBYbs48dA9wSbZNhbpw8NLDNq+/TQ9VW5y3CsxX0V7Td2 luEzNLbp8bSF6ffaO16O8dH3VrO9/xGv4FKrjV8tUWBUUqpo6N9BrLUQqcPs6Qy4eget 3luQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u7-v6si881635pgh.592.2018.08.27.18.55.06; Mon, 27 Aug 2018 18:55:06 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728000AbeH1FoU (ORCPT + 32 others); Tue, 28 Aug 2018 01:44:20 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:45090 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727516AbeH1FoU (ORCPT ); Tue, 28 Aug 2018 01:44:20 -0400 Received: by mail-oi0-f65.google.com with SMTP id t68-v6so1698785oie.12 for ; Mon, 27 Aug 2018 18:55:04 -0700 (PDT) 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:in-reply-to :references; bh=Rh6W76aERtj34AivYjBtIfo6EjHUyukF1dZUI0dMekc=; b=iTTqaBD5eigvoyZNA9fUrOP7hwR5uhodGpiscidA4hJVIswyG2KrmW08nU4YVusCpW bB+UnN3r+h/QEiX/HzdEFOWxNSlb+p1XO3SMEJEj0ETMoMvth2XQuMdSxwKVw1JxI9GC 7PoYRxFNbtgOm2X0YNxuZERwA4WKr5UFQZvCrNsmHe6oiSPQN85pXpRF4z3VCnXQi5fp zxPtoyexUkcEE5mJCjHGC450ert06j3ePQEEUimwxhbnHGe8mMQrkxICl8NJnbSwCKwp WSD4FtXJBmtFu2wA+aMgHxlNcDTbbnwlZh9SjmoAN782IrLeFHNm6Npq31NZjKPRsLFt WHIA== X-Gm-Message-State: APzg51D+VO5uf/fS8E/j5Rh2PxevRmq/WdG+N1z0aXxnSFbWH5RDetcH UEt5B4hweoqPvmRoDZdASCL34T0= X-Received: by 2002:aca:56d1:: with SMTP id k200-v6mr1140894oib.319.1535421303954; Mon, 27 Aug 2018 18:55:03 -0700 (PDT) Received: from xps15.herring.priv (24-155-109-49.dyn.grandenetworks.net. [24.155.109.49]) by smtp.googlemail.com with ESMTPSA id n71-v6sm1652696oig.48.2018.08.27.18.55.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Aug 2018 18:55:03 -0700 (PDT) From: Rob Herring To: linux-kernel@vger.kernel.org Cc: Srinivas Kandagatla Subject: [PATCH] nvmem: Convert to using %pOFn instead of device_node.name Date: Mon, 27 Aug 2018 20:52:38 -0500 Message-Id: <20180828015252.28511-37-robh@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180828015252.28511-1-robh@kernel.org> References: <20180828015252.28511-1-robh@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- drivers/nvmem/core.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) -- 2.17.1 diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index aa1657831b70..6988ee9f11ba 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -304,6 +304,7 @@ static void nvmem_cell_drop(struct nvmem_cell *cell) mutex_lock(&nvmem_cells_mutex); list_del(&cell->node); mutex_unlock(&nvmem_cells_mutex); + kfree(cell->name); kfree(cell); } @@ -879,7 +880,7 @@ struct nvmem_cell *of_nvmem_cell_get(struct device_node *np, cell->nvmem = nvmem; cell->offset = be32_to_cpup(addr++); cell->bytes = be32_to_cpup(addr); - cell->name = cell_np->name; + cell->name = kasprintf(GFP_KERNEL, "%pOFn", cell_np); addr = of_get_property(cell_np, "bits", &len); if (addr && len == (2 * sizeof(u32))) { @@ -904,6 +905,7 @@ struct nvmem_cell *of_nvmem_cell_get(struct device_node *np, return cell; err_sanity: + kfree(cell->name); kfree(cell); err_mem: