Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp1478840rwd; Thu, 25 May 2023 13:15:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6FzDUsn85L3SYQG54xULoVkooXj7rnlbKwqRdmL2wPpezwdviddVkO4jYZWCNTFRFDVhUH X-Received: by 2002:a05:6a00:21ce:b0:63b:8a91:e641 with SMTP id t14-20020a056a0021ce00b0063b8a91e641mr10386144pfj.11.1685045752653; Thu, 25 May 2023 13:15:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1685045752; cv=none; d=google.com; s=arc-20160816; b=BWZwSwYhV5frF3RgAo8SFZMrJ9OGgsx7dPSCPddCessuvJGVNaWx/986r2LTNtivFB raqxlCasanV1rL+5bYHDnF4Mp1+9/rxkkR8AhgJUpIIQx/atrbRdDRy6ul2uXjcjpoHQ lgoc+O3WPRqm7MnnW1mbSpk61D7mvLrBUzwFQ3kbSFqE+o//rorA1D//MC08VkSII2gA WOr4gjlvUSzo4c84mGZeGtbPlTm0Hfac3REVog7Pb2O7MW10Cj9KUbSstHDzbUC4EOMr kDCNkc9mGtSnZ+2WJ19wbo+WR32qv4Ivpnp4HWhiY6bc6Q8dmgiNGaSSHpWFMyatvVMe rVqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=cdwDlTSY5nLJWFnEJZ9cFeJSFlxNwy4TcFGd8KOVKQY=; b=jB2kZafROx7xtM09V1LMrCepkMp16uNt4xMmRVEm9QTV5ULw/gK33qIlMl/eVrDOly HWKNFaQpvqMTZVLhGnUvDie7UkXGtkZLWAAbBh0jFqsEZLYgBJRyI9wFLCVcxOCm8G9G pifcQPsn5MdJEhKL7lzxl2TQBhb+Mj6zbISTIPkCiTsLgYF0LOIX9cZwarPYvAycgAbj bEaOkeVQtCnoHRSFT/VlGm5anSb8WBvV7dcxQLf5CUzqC2+0nppCc96mTXYeZrIcmbl5 juXd3EdIk7G46QNt8GCeBJIQk7teeQpC2OYplJeSAwygydIS5oItKmjMHQKHo2b/BZtc k7gA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=HFT9MXOA; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w11-20020aa79a0b000000b0064f3b3cfb43si2138787pfj.161.2023.05.25.13.15.37; Thu, 25 May 2023 13:15:52 -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=@wanadoo.fr header.s=t20230301 header.b=HFT9MXOA; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243085AbjEYT1X (ORCPT + 99 others); Thu, 25 May 2023 15:27:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243639AbjEYT1G (ORCPT ); Thu, 25 May 2023 15:27:06 -0400 Received: from smtp.smtpout.orange.fr (smtp-22.smtpout.orange.fr [80.12.242.22]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id B008E9B for ; Thu, 25 May 2023 12:25:38 -0700 (PDT) Received: from [192.168.1.18] ([86.243.2.178]) by smtp.orange.fr with ESMTPA id 2GRsq4ImI4WeJ2GRtqoeWa; Thu, 25 May 2023 21:16:36 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1685042196; bh=cdwDlTSY5nLJWFnEJZ9cFeJSFlxNwy4TcFGd8KOVKQY=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=HFT9MXOA+YJs9tcYjw3E2SCcaV6P49sY+lqyK/urEYTqhQPWDrLjUzSmLlciPDHkF SV/AfgVXxXZ2C00ETDTBu0scNPIGNAcxC50lok1FZOj/1xRkkdxAMCm15wrUY+TH6O 3/S6wgweKUxHGIjEU3A3zAQIr5d4imxjqNwxpj3tng7XVUW0zcQ+Rma+rH/ZhSBc6u JqlnArApxBZM0Co6zKrIqArtUDTPzD9X971fKC0oVCtZDr/0k9L15NHq8rqyNgS0pW q7JpsV6SVYm3z2T7MGD/GaLwYSc1N6lDyBUPSI4TRlPPQ7JBrmO9dHlcFW37AvydOg ykXHiYNVR4w1g== X-ME-Helo: [192.168.1.18] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Thu, 25 May 2023 21:16:36 +0200 X-ME-IP: 86.243.2.178 Message-ID: Date: Thu, 25 May 2023 21:16:32 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH v3] i2c: ocores: use devm_ managed clks Content-Language: fr, en-US To: =?UTF-8?B?5byg572R?= Cc: Peter Korsgaard , Andrew Lunn , hust-os-kernel-patches@googlegroups.com, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org, Dan Carpenter References: <5572a733.abc0.18846f13b0b.Coremail.m202171703@hust.edu.cn> <20230524154318.2259-1-silver_code@hust.edu.cn> <68c4b991-6af9-36e8-354c-7c3b232ba4c2@wanadoo.fr> <5cceb5b5.c1fe.18850f830e0.Coremail.m202171703@hust.edu.cn> From: Christophe JAILLET In-Reply-To: <5cceb5b5.c1fe.18850f830e0.Coremail.m202171703@hust.edu.cn> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Le 25/05/2023 à 05:33, 张网 a écrit : > Hi Christophe, > > Thanks for your suggestions. However, both clk_get_rate and clk_prepare_enable > will return 0 if i2c->clk is NULL, so I think we may not need to take this issue > into account. > > Regards, > Wang Zhang > Ouch! For some reaon, when I read: > + rate = clk_get_rate(i2c->clk) / 1000; I read "if i2c->clk is NULL, then the i2c pointer is NULL as well and is dereferenced". :/ sorry for the noise. CJ (slightly ashamed)