From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 12F3FC4332F for ; Mon, 25 Apr 2022 16:18:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238091AbiDYQVr (ORCPT ); Mon, 25 Apr 2022 12:21:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43544 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235135AbiDYQVq (ORCPT ); Mon, 25 Apr 2022 12:21:46 -0400 Received: from mail-qk1-f174.google.com (mail-qk1-f174.google.com [209.85.222.174]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EAE485C845; Mon, 25 Apr 2022 09:18:41 -0700 (PDT) Received: by mail-qk1-f174.google.com with SMTP id d19so11141997qko.3; Mon, 25 Apr 2022 09:18:41 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WmopMEhO5sJFa6N97UeuS8xj6v439U2xJGJI9H+fOkk=; b=DxX5Ty4jmUn0D5FNwwBv8ooLxTYpmWIUGhJWQHyWn/Gu8xpyCAf4ypFNeUDgv9c9Mw 6zj1ti+x60e9rgU28CEFTRPJRfItC4IBhZtnQixRfUj43uUsmrSIMkhcQUcOFTwFvITK Ll4eHdb0yWsKXVxN2ch75luSIi2ZxwlHFLMohNSK+SqJOaSqFVP1bQ9Do+SnqKDQ2up/ jWI6eXGyHgsG17ZMdoEacrNtWNi3EMxarvQFTZkU6e1ZkkctcInQEOpkoga3p4mNP/R1 3ihZ1zlp9WW4iIMbxDK3vKbXbgS9HtXFEqcTvJzqpJhXwLJ6R0att11pyTo07S01Tcjk N0Vg== X-Gm-Message-State: AOAM533Y2TWMuGUGLRSMCWugUaraqXTy9X4Fs79Jwioksfb+hLKrmgIJ 0XFImG2jS/6HLkpTmQQUKH+kLtAnN5SGTg== X-Google-Smtp-Source: ABdhPJxTWChXVzYuuLjx4uora+ov5MmoM4yvCSzOIhk+JG+tW4wFW6PgktnEbFI55VZoLa0olNSaaA== X-Received: by 2002:a05:620a:4611:b0:69f:6a64:e694 with SMTP id br17-20020a05620a461100b0069f6a64e694mr1633421qkb.36.1650903520803; Mon, 25 Apr 2022 09:18:40 -0700 (PDT) Received: from mail-yb1-f175.google.com (mail-yb1-f175.google.com. [209.85.219.175]) by smtp.gmail.com with ESMTPSA id d15-20020ac84e2f000000b002f36938f259sm1873797qtw.91.2022.04.25.09.18.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 25 Apr 2022 09:18:40 -0700 (PDT) Received: by mail-yb1-f175.google.com with SMTP id r189so27977419ybr.6; Mon, 25 Apr 2022 09:18:40 -0700 (PDT) X-Received: by 2002:a25:8087:0:b0:641:dd06:577d with SMTP id n7-20020a258087000000b00641dd06577dmr16564168ybk.207.1650903519962; Mon, 25 Apr 2022 09:18:39 -0700 (PDT) MIME-Version: 1.0 References: <20220421085112.78858-1-miquel.raynal@bootlin.com> <20220421085112.78858-7-miquel.raynal@bootlin.com> In-Reply-To: <20220421085112.78858-7-miquel.raynal@bootlin.com> From: Geert Uytterhoeven Date: Mon, 25 Apr 2022 18:18:28 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v11 6/9] clk: renesas: r9a06g032: Probe possible children To: Miquel Raynal Cc: Magnus Damm , Gareth Williams , Phil Edworthy , Vinod Koul , Linux-Renesas , dmaengine , Milan Stevanovic , Jimmy Lalande , Pascal Eberhard , Thomas Petazzoni , Herve Codina , Clement Leger , Stephen Boyd , Michael Turquette , linux-clk , Viresh Kumar , Andy Shevchenko , Ilpo Jarvinen , Rob Herring , "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org Hi Miquel, On Thu, Apr 21, 2022 at 10:51 AM Miquel Raynal wrote: > The clock controller device on r9a06g032 takes all the memory range that > is described as being a system controller. This range contains many > different (unrelated?) registers besides the ones belonging to the clock > controller, that can necessitate to be accessed from other peripherals. > > For instance, the dmamux registers are there. The dmamux "device" will > be described as a child node of the clock/system controller node, which > means we need the top device driver (the clock controller driver in this > case) to populate its children manually. > > Signed-off-by: Miquel Raynal > Acked-by: Stephen Boyd Thanks for your patch! > --- a/drivers/clk/renesas/r9a06g032-clocks.c > +++ b/drivers/clk/renesas/r9a06g032-clocks.c > @@ -996,7 +997,7 @@ static int __init r9a06g032_clocks_probe(struct platform_device *pdev) > > sysctrl_priv = clocks; > > - return 0; > + return of_platform_populate(np, NULL, NULL, dev); This is a bit dangerous: in the (very unlikely) case that of_platform_populate() fails, the clock driver will fail to probe, and all managed cleanup will be done (not everything will be cleant up, though), while sysctrl_priv will still point to the now-freed r9a06g032_priv structure. So I think you just want to ignore the failure from of_platform_populate(), and return zero anyway. > } > > static const struct of_device_id r9a06g032_match[] = { Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds