Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp3563497rwb; Mon, 7 Aug 2023 16:07:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEJ/g6jRYhqQqaZ9Cy9enq+qG/EuZyjff9Ds+H2z9+i15yaI8ShvtxBSht1TLme9PUIvAhX X-Received: by 2002:a05:6a20:734f:b0:13d:ea25:9642 with SMTP id v15-20020a056a20734f00b0013dea259642mr12066429pzc.6.1691449643873; Mon, 07 Aug 2023 16:07:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691449643; cv=none; d=google.com; s=arc-20160816; b=piO1n+3Oe77jwgkvkfngxDWzY5tJ/3gAsah+IPr8wmwPbRhpMTQp57SKHWB7IV+ClV KfLnYVwtCxsiRCLUs5g6BlcqfZK8dIQh+wzi6L9o9ST6zG9K6n0LN7g/wKQX1ip5GE6B lrp3EXCbE8sK6U7JMFA0EAUmgYur9NDYfNQcaLl81EMy1IWm4mrm65gK9yMGJlFc6nMZ rknZ4igzDCLk/MbpOHPkz/ah6/UcqDEs/393itX8QYYS8VDVGBsETmF8ht+haGSOKhrP UwwxNBFFsBk8B8nRltX/zmEQWfepfWZqugHP7q6VdQVT2W6Gp/2b/v0QyG0Acmmcxww8 EVnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=vCo6mzv/6KzsiJLKEnyKjWfdixrO4ystW67tX4HhrOg=; fh=EM10MvLcQLGCZtsEgp5F+5LdKdwRtRp1xripwDbYfwo=; b=KSl95YnxXAOuSPtridwKqw0ikFNq+ypJLRIl8n2Vp2TJrPMtqvWxllFI7RVVUzkD7g 7cNsT8Ib2+WKIp7M3xZKrhRSlKJ+VSrIm4/wbKjuwpLtbPOSgwCNwvhpPbX/0bCuXNmz BTAqdGvOA4XJ7VXyAl7ixJL0sT876NLbUreVKeDn7WFWh7RWS7Uaf97xShPjcU6so4ma 0HaZA5+RER9aWljU47W5ydPsdmq49RvUCIfxzeJmCgqs70bz/+/se1zGyXCZnTTdhuGO Yyt4Dl/hZ58YdFGBFjiM/MsCqpMakHkQWwC2oHahr+iY3xg2BosLilSJoScqZ7FvIQsT p72Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=N9kDJ3oH; 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=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b9-20020a63d809000000b00564c67e66fbsi2948011pgh.842.2023.08.07.16.07.11; Mon, 07 Aug 2023 16:07:23 -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=fail (test mode) header.i=@armlinux.org.uk header.s=pandora-2019 header.b=N9kDJ3oH; 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=fail (p=NONE sp=NONE dis=NONE) header.from=armlinux.org.uk Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230175AbjHGWgl (ORCPT + 99 others); Mon, 7 Aug 2023 18:36:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60518 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229499AbjHGWgk (ORCPT ); Mon, 7 Aug 2023 18:36:40 -0400 Received: from pandora.armlinux.org.uk (unknown [IPv6:2001:4d48:ad52:32c8:5054:ff:fe00:142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3BC74F0; Mon, 7 Aug 2023 15:36:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=armlinux.org.uk; s=pandora-2019; h=Sender:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=vCo6mzv/6KzsiJLKEnyKjWfdixrO4ystW67tX4HhrOg=; b=N9kDJ3oHekpUy0kQiCa21v5OEc 3rv43ZEU5Kn+zXj3KdP5tzzMGyKP1xZyaIUwwhzqBWin3rvlVxaz2o3/QnQn4lixdtV8kREziyc4k 8BXLeTgCR+0p6W+2IKDtbTx4ee1kr7ly9lTVnFqG/hOXvI0UIPYjfAY5yqx8okjeLGRnn2G4njC+f dHZBRoR/IulcJOP8HIG8hZiQPMsM2YnkD27vwoxXVnphaRg9Zogqf6ZfZ75mUXhjjLO1TBg7JtQgx ozlJwGCePAMK+14VLf2wl0mF0c+xohBOUyQ+KZrOgMOSMM9Srshqp0XkH7v+im1AooBZTosBoGOsO Uw04+fZQ==; Received: from shell.armlinux.org.uk ([fd8f:7570:feb6:1:5054:ff:fe00:4ec]:33176) by pandora.armlinux.org.uk with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1qT8py-0005qB-0q; Mon, 07 Aug 2023 23:36:30 +0100 Received: from linux by shell.armlinux.org.uk with local (Exim 4.94.2) (envelope-from ) id 1qT8pw-0007Q6-Bf; Mon, 07 Aug 2023 23:36:28 +0100 Date: Mon, 7 Aug 2023 23:36:28 +0100 From: "Russell King (Oracle)" To: Andrei Coardos Cc: linux-kernel@vger.kernel.org, linux-rtc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, alexandre.belloni@bootlin.com, a.zummo@towertech.it, sebastian.hesselbarth@gmail.com, gregory.clement@bootlin.com, andrew@lunn.ch, alex@shruggie.ro Subject: Re: [PATCH] rtc: armada38x: remove unneeded call to platform_set_drvdata() Message-ID: References: <20230807124811.16763-1-aboutphysycs@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230807124811.16763-1-aboutphysycs@gmail.com> Sender: Russell King (Oracle) X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED,RDNS_NONE, SPF_HELO_NONE,SPF_NONE autolearn=no 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 On Mon, Aug 07, 2023 at 03:48:11PM +0300, Andrei Coardos wrote: > This function call was found to be unnecessary as there is no equivalent > platform_get_drvdata() call to access the private data of the driver. Also, > the private data is defined in this driver, so there is no risk of it being > accessed outside of this driver file. I hope you're not going about doing this _broken_ thing and thinking "if there's no platform_get_drvdata(), then there shouldn't be any platform_set_drvdata()" because that is WRONG. Wrong wrong wrong wrong wrong. platform_set_drvdata(pdev, foo); sets the driver data on dev, and is basically implemented as: dev_set_drvdata(&pdev->dev, foo); So, to access the driver data, one can either use: platform_get_drvdata(pdev) or: dev_get_drvdata(dev) where one is dealing with a "struct device" pointer. So, the lack of any platform_get_drvdata() does *NOT* mean that platform_set_drvdata() can be removed. If that's what you've been doing, you are *creating* bugs - and you need to stop until you properly understand what you are doing. Thanks anyway, but... your change is totally wrong and will wreck the driver, causing it to oops the kernel. Strong and definite NAK. I do *NOT* expect to ever see a patch like this again for this driver. Thanks. -- RMK's Patch system: https://www.armlinux.org.uk/developer/patches/ FTTP is here! 80Mbps down 10Mbps up. Decent connectivity at last!