Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp452146rwd; Thu, 1 Jun 2023 02:33:01 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ576lkR1ujxb4/irjjU2AMhH3zlG7CnfWaknX/EWl2Pqj+mI5rd4RxcB3PvTdNNhAth82xF X-Received: by 2002:a05:6a00:805:b0:63b:854c:e0f6 with SMTP id m5-20020a056a00080500b0063b854ce0f6mr11681184pfk.21.1685611981014; Thu, 01 Jun 2023 02:33:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685611980; cv=none; d=google.com; s=arc-20160816; b=kNjO+Nz2OveBD20wmWb6od4BQNAfTB42TlOV/p9HENPI6Zj5LbJrhZUW4VaEVNzlwg gYHu+gUseyd+c0D1+ENBENSDj6J4wCB1KYkem+HkKuD9UDuRTN+ugmvHISWDvdSCDOaM aRb2lDuCAs22zibkAeIKmb+aJMwdC4ibNDlgmm/Vp9wAn2L3iCoATtlNblPzoeIfPBQk ugDCjDkyJESjXTxz0I5x2ZUTgLofzSJn1MZru0mP78UrBGwi0aJJ3pTU+FBr+KOtt8bT L5ZVLBO7YTBF/++10dcOzJgxvB9Jom/NOXxjJRYO8ZR72WhfJVNrf7JpT9l0JVoGqVK+ bV2g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=ZirR1WPIJZVNOLvDsPuKt8AD0CB88Nj04n86hhjg6i4=; b=DMyXVdykIZ7FXMxT461+tu5H4UAnRxbpd0aMfKU+I0Gy7pNtpcyFCqpQDnQWpY2Hxh nMD9aJsGrbLw7VD98LMILnhu4nZDAT3KRCpY5O40RobhTk27PumSf4poiuqydsMbt9uD T6OIlk0uZIartyrWz1TwkAlfGqVIGvBWyP5jY8dyPaOAebkxdT6Ycj7bf+id6UxexA41 nyPz/mdrQzfMn3sj8r+bg9kr97EipxiFR2oeUe6dxfzLmKngmuB22nVLeYeLHORe10GV ulWyJT4sqKNiV94tlhB55bw7LdN1mj2JUEjnEZihSnv0wGmg2HbBpjpnOlHYlDG/Uv+2 r5/w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="bcFdQRt/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c8-20020aa79528000000b0064f4865a125si5083535pfp.8.2023.06.01.02.32.47; Thu, 01 Jun 2023 02:33:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="bcFdQRt/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232476AbjFAJ1v (ORCPT + 99 others); Thu, 1 Jun 2023 05:27:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232417AbjFAJ1s (ORCPT ); Thu, 1 Jun 2023 05:27:48 -0400 Received: from mail-lf1-x133.google.com (mail-lf1-x133.google.com [IPv6:2a00:1450:4864:20::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 06BAB124; Thu, 1 Jun 2023 02:27:47 -0700 (PDT) Received: by mail-lf1-x133.google.com with SMTP id 2adb3069b0e04-4f3ba703b67so631184e87.1; Thu, 01 Jun 2023 02:27:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1685611665; x=1688203665; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=ZirR1WPIJZVNOLvDsPuKt8AD0CB88Nj04n86hhjg6i4=; b=bcFdQRt/Wb1QEUUyH/8czxy/qX1tuWNPn16ZkMi/qptS5kWAuWYaxBeIGNmgDz3qbz Qg3nQQF/fIkfE4R/n3S8sPvSdn8f2rZ9gT7wLyHP0BY8lgkrkr1CEf9AkVG3YImKSxB/ Xyf4Jm0advOdKas6jyQj0AVOnHrCR4IqWiX7XB84QGN4SuwKlF6CjMyo1vuJij2L7zmt +ICG3wAEYxmG5/ueQIt09FTvsJYZkSzpJir3cIODfnIThrSxNiNwm9zpnX1L6V7EgK+F dNheodiIBH5pwSBPyYWcsLnZBfMAU28wm7rgdSZzGXYQ7gdO1asBwYe+5YnYSTcN4Aca oC8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1685611665; x=1688203665; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ZirR1WPIJZVNOLvDsPuKt8AD0CB88Nj04n86hhjg6i4=; b=gzYM81k26RAldjIro03sT6LhfwDMbfVULrpQK+r6gjybgwZhbNArYBdUEHo2NjhEyv iByq9NdbO3IWPKAO2Pum+ieyRS5d/Y3T//+j4WFXCZjI1L9AcTGsT4r8FWM1An3f3rag lqHd6NDzsQS/cJ94ZH6UrwCUEMTRpPmohjmIizbqX0TzMgDZ+7vccLnJXbf+aKJtZtzk XJ79Xu1dt1p5pAQaOiUWvfFbARiKJo4mq1g3VachHfWWEAaOUL/sQrLipw7m+WpHIgZm Qzks6ESr8CdMU07MpVa59eonYXiGa5XHQ7JGPX9P5Kac8b4qvoGgCWqp4VrJ8GDrv+qX 8sUQ== X-Gm-Message-State: AC+VfDyPhso0GgZf5QGgUk4tjwLoGuMWPgfeR+xEmYZ9kNZeNyRvOa8i zs3tux66aXuCJBkLeQwFxedJ06mhzT89Y6wjHpg= X-Received: by 2002:a2e:7215:0:b0:2b0:4c72:98ff with SMTP id n21-20020a2e7215000000b002b04c7298ffmr4131381ljc.7.1685611665030; Thu, 01 Jun 2023 02:27:45 -0700 (PDT) MIME-Version: 1.0 References: <20230521143202.155399-1-tmaimon77@gmail.com> <20230521143202.155399-2-tmaimon77@gmail.com> <0e72c35f-5d9d-45a7-5f85-3971b8029106@wanadoo.fr> In-Reply-To: From: Tomer Maimon Date: Thu, 1 Jun 2023 12:27:33 +0300 Message-ID: Subject: Re: [PATCH v16 1/1] clk: npcm8xx: add clock controller To: Christophe JAILLET Cc: mturquette@baylibre.com, sboyd@kernel.org, avifishman70@gmail.com, tali.perry1@gmail.com, joel@jms.id.au, venture@google.com, yuenn@google.com, benjaminfair@google.com, openbmc@lists.ozlabs.org, linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Stephen, Kind reminder regarding the patch, appreciate your comments. Thanks, Tomer On Mon, 29 May 2023 at 18:52, Tomer Maimon wrote: > > On Mon, 22 May 2023 at 20:36, Christophe JAILLET > wrote: > > > > Le 22/05/2023 =C3=A0 14:56, Tomer Maimon a =C3=A9crit : > > > Hi Christophe, > > > > > > Thanks for your comments > > > > > > > [...] > > > > >>> +static struct clk_hw * > > >>> +npcm8xx_clk_register_pll(struct device *dev, void __iomem *pllcon, > > >>> + const char *name, const struct clk_parent_da= ta *parent, > > >>> + unsigned long flags) > > >>> +{ > > >>> + struct npcm8xx_clk_pll *pll; > > >>> + struct clk_init_data init =3D {}; > > >>> + int ret; > > >>> + > > >>> + pll =3D kzalloc(sizeof(*pll), GFP_KERNEL); > > >> > > >> Everything looks devm_()'ed in this driver, except this kzalloc. > > >> Except the one below, there is no kfree to free this memory, and no > > >> .remove() function. > > > Also clk_hw_register_divider_parent_data doesn't use devm_ > > > about free the pll, we use it, return at the end of the function. > > > about adding remove, we had a dissection about it in V4, since the > > > clock is a service driver it shouldn't be removed. > > > https://patchwork.kernel.org/project/linux-watchdog/patch/20220621131= 424.162355-7-tmaimon77@gmail.com/ > > > > LoL. > > At least, I'm consistent :). > > > > Just to make it clear, what I mean about kfree() is not to add one here= , > > but either: > > - to use devm_kzalloc() here, to avoid a leak, should loading the > > driver fails OR > > - have some kfree() where needed (at least in the error handling > > path of the probe, if the remove function makes no point) > O.K. Thanks for your clarification. > > > > CJ > > Best regards, > > Tomer