Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753320AbbEROqA (ORCPT ); Mon, 18 May 2015 10:46:00 -0400 Received: from smtp.csie.ntu.edu.tw ([140.112.30.61]:50435 "EHLO smtp.csie.ntu.edu.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752344AbbEROp5 convert rfc822-to-8bit (ORCPT ); Mon, 18 May 2015 10:45:57 -0400 MIME-Version: 1.0 In-Reply-To: <5559ADBE.7060506@gmail.com> References: <1431707940-19372-1-git-send-email-jenskuske@gmail.com> <1431707940-19372-4-git-send-email-jenskuske@gmail.com> <5559ADBE.7060506@gmail.com> From: Chen-Yu Tsai Date: Mon, 18 May 2015 22:45:29 +0800 Message-ID: Subject: Re: [PATCH v2 03/10] clk: sunxi: Let divs clocks read the base factor clock name from devicetree To: Jens Kuske Cc: Chen-Yu Tsai , VishnuPatekar , Rob Herring , linux-kernel , Mike Turquette , devicetree , Hans de Goede , Linus Walleij , Maxime Ripard , linux-arm-kernel , linux-sunxi , =?UTF-8?Q?Emilio_L=C3=B3pez?= Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1791 Lines: 51 On Mon, May 18, 2015 at 5:15 PM, Jens Kuske wrote: > Hi, > > On 05/16/15 04:10, Chen-Yu Tsai wrote: >> 2015年5月16日 上午12:39於 "Jens Kuske" 寫道: > [..] >>> @@ -1141,6 +1133,7 @@ static void __init sunxi_divs_clk_setup(struct >> device_node *node, >>> struct clk_gate *gate = NULL; >>> struct clk_fixed_factor *fix_factor; >>> struct clk_divider *divider; >>> + struct factors_data factors = *data->factors; > > Isn't this a copy? You're right. Sorry for the noise. > >>> void __iomem *reg; >>> int ndivs = SUNXI_DIVS_MAX_QTY, i = 0; >>> int flags, clkflags; >>> @@ -1149,8 +1142,17 @@ static void __init sunxi_divs_clk_setup(struct >> device_node *node, >>> if (data->ndivs) >>> ndivs = data->ndivs; >>> >>> + /* Try to find a name for base factor clock */ >>> + for (i = 0; i < ndivs; i++) { >>> + if (data->div[i].self) { >>> + of_property_read_string_index(node, >> "clock-output-names", >>> + i, &factors.name); >> >> Please excuse the bad formatting. >> I'm at the airport without my laptop. >> >> This will not work. All the static factors_data structs are const. >> You should make a copy of it, maybe on the stack, >> update the .name field, and pass that to sunxi_factors_clk_setup(). >> > > If I didn't miss anything, or misunderstood what you want to copy, this > should be working fine. > > Jens > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/