Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4666131yba; Mon, 20 May 2019 01:20:47 -0700 (PDT) X-Google-Smtp-Source: APXvYqxuy8shPQMlRsMSCQ5/rGZEZmWhulkmGj/bbNMmGIQ5jNKvfwpm01LR02Px8Tohl9uWE3zC X-Received: by 2002:aa7:8d81:: with SMTP id i1mr51070669pfr.244.1558340447729; Mon, 20 May 2019 01:20:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1558340447; cv=none; d=google.com; s=arc-20160816; b=I6lbHz19eSvao+uCHPv96diecwCQ3nh36PV49RwgjfLpiqygdnFCzBt7h+w1nqwGni rSLdBIoLj1+DM1MHJhXwaOUso2PeuaTV2Lpc1DIhW1P3aQZksq/Hi8F+o28BtJ+IlZ1s mVIbFo4FDFKFrSsWQ+z/slMh2wDFu02/rR1Kviyuk3v4itu7kKYSIckNbW5Yo3MdEGj4 JNhX+usYU/g+P36wVjFq4EI1uC9U19K3/uP6qnGAKa1Q/AQWSRgAYWeVOu2rW3icIW79 6erF2QBFj8YVmWDOxhrUnc+XUcoD5VSV2q4t60jdmzmxYTCZRe5OkWCv6XpGH0mwicCN 45nQ== 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 :dkim-signature; bh=3J2HJajJCb36bM8xTf3I2c4gAFMeL1PnCgqc6f8WTJQ=; b=YNyoM0FZVbeQSFpHTJvV9A4+5VhHgOGjPXe63+VPtmk3orhxvG5BZ5RAcVKHWoxwD+ /rjiXLQgt6DK/+h1WPrktjimtDIeP4aYbnQTAUbMds8u3nDj7x5fhcAsAvpsOmy/i62U KajAZvKewdlEVtmM5iouxuQF+AivUrrOl5SugOcSnt1+WIolLQK7atzve8qEsQ+epkZh ulvMjrs6RvJH4PFXlwo7JHWzHe+7sFftrRMDz4B1WeroplBHZt7DN57PFxskC69szg55 g6WAEZgs2MQrj97wQpN2xDfuM6GOrJ3JHRL78U6f96ZpJsrrdb1Jc4yZ6kg/LqpssB+L hiqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=ohkKS1kF; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o7si16765422pgl.301.2019.05.20.01.20.32; Mon, 20 May 2019 01:20:47 -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=@kernel.org header.s=default header.b=ohkKS1kF; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730701AbfETIFf (ORCPT + 99 others); Mon, 20 May 2019 04:05:35 -0400 Received: from mail.kernel.org ([198.145.29.99]:36258 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730659AbfETIFf (ORCPT ); Mon, 20 May 2019 04:05:35 -0400 Received: from wens.tw (mirror2.csie.ntu.edu.tw [140.112.30.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CABDC20863; Mon, 20 May 2019 08:05:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1558339535; bh=Wtf8ydMMfyfJ3sAFi/Hglgs7fc07JVIK7VJrnPdLjpg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ohkKS1kFeDs6AhPfm0BNhc9ncVna0zNXm3TuOb/f415FmPUmgzkuJN3D3fmyfO4dV msBkbh4oDb4g9ejSUgHSxDiE+kQVFKeqFbUvskJZHcZf0cOKdrOurBr3vDRgp8WwiP 6wGIau8oUMVS68VhR3fzBU00in/UlHRKWLPp+4rs= Received: by wens.tw (Postfix, from userid 1000) id 2AD595FABC; Mon, 20 May 2019 16:05:32 +0800 (CST) From: Chen-Yu Tsai To: Maxime Ripard , Stephen Boyd , Michael Turquette Cc: Chen-Yu Tsai , linux-arm-kernel@lists.infradead.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 01/25] clk: Fix debugfs clk_possible_parents for clks without parent string names Date: Mon, 20 May 2019 16:03:57 +0800 Message-Id: <20190520080421.12575-2-wens@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190520080421.12575-1-wens@kernel.org> References: <20190520080421.12575-1-wens@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chen-Yu Tsai Following the commit fc0c209c147f ("clk: Allow parents to be specified without string names"), the parent name string is not always populated. Instead, fetch the parents clk_core struct using the appropriate helper, and read its name directly. Fixes: fc0c209c147f ("clk: Allow parents to be specified without string names") Signed-off-by: Chen-Yu Tsai --- drivers/clk/clk.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index aa51756fd4d6..bdb077ba59b9 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c @@ -3000,12 +3000,16 @@ DEFINE_SHOW_ATTRIBUTE(clk_flags); static int possible_parents_show(struct seq_file *s, void *data) { struct clk_core *core = s->private; + struct clk_core *parent; int i; - for (i = 0; i < core->num_parents - 1; i++) - seq_printf(s, "%s ", core->parents[i].name); + for (i = 0; i < core->num_parents - 1; i++) { + parent = clk_core_get_parent_by_index(core, i); + seq_printf(s, "%s ", parent ? parent->name : NULL); + } - seq_printf(s, "%s\n", core->parents[i].name); + parent = clk_core_get_parent_by_index(core, i); + seq_printf(s, "%s", parent ? parent->name : NULL); return 0; } -- 2.20.1