Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp965682rdb; Fri, 2 Feb 2024 09:10:54 -0800 (PST) X-Google-Smtp-Source: AGHT+IEtgpnvNKiYb22WV1ZaCQh1BeL7iK4mFVQSpuHW60jAfN+YT0g6SI0yNK4eOCixvN4XP0Xg X-Received: by 2002:a17:906:3515:b0:a36:2dc:1903 with SMTP id r21-20020a170906351500b00a3602dc1903mr4440173eja.68.1706893854336; Fri, 02 Feb 2024 09:10:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706893854; cv=pass; d=google.com; s=arc-20160816; b=htR32+aXWMTZdsIH307DGr5GqTMxOumvOgYmA5KarHyjaAORkvZTIr7cXbTiHA4Ph8 iDvhHNv/aR0TChF1/nvKDf2xOm/hLGtKV1GqBYSZYCnHda0vW9fHgfTwCPluv70APnQs Y9LU/xABb10DRn4jNiIcYaxggUypuSayNFwJ9hiKU8AxCrJW7RsfhYRIWhGjo4rwq1de 6aERgCOwh61ygiNGCVLaMGvHqZrD2XlONt7bNXJocnfaSqR4YN3+yRK0IpVpQOCZA+2A m6tRgDdguIgzdChi9t298OZQVarjiFbHeI5DMxSLWQO5EUhcYKNgT09Mr7x38w6WKFC3 jHWQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=xBboSvhnv3xL8BrH5HURwKtLYk60Bcq74cRcWVNCjGA=; fh=nRqSVltYJbahhYcCABIbDK5ZBgNOCwvqBGtbv/oUq9M=; b=lhIw6unqCafpwN4qyAvSaIO31KDUdztHkiVVaiRkod0oB7rTDXTJDXvXY2qIfiizj1 3XhOzF2NvB2V/1mvcpjs0iEj2P7lJjv4DNq+v0drdKBnMY2bxbMjY7EuY8tVeon3p9nr qMWcy6bdhxwfaXNERaT4+G6Rl/auSNGMnPx2eEH6qyBFhEawYkv4K4lReiy6LmYLBQf/ /PMloKR+oWOy1rxlM3CkiqUTjHUasGWXUvUifo0pvMXgdZFO7JZhN93PnSfPatTfNl25 iCruj2RR+RyBJbhDvusU9453k4MKm33qvmc1C26AIr6dLFLxmPxP/H2YbtBgrAOwTk+B 520Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=CFz4Mlp0; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-50212-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50212-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch X-Forwarded-Encrypted: i=1; AJvYcCWQ0NicVHwLXIpRTUEemFB+GpRiYgBvigOfdHdTuGVZvxSKXFjN6mxghFYAE80NsBpqWd0Xj4rzoWx8ZOPfxgKY2yvk2u6Ptsw4b2shsA== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id h13-20020a1709063c0d00b00a357f820328si972593ejg.840.2024.02.02.09.10.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 09:10:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-50212-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@lunn.ch header.s=20171124 header.b=CFz4Mlp0; arc=pass (i=1 spf=pass spfdomain=lunn.ch dkim=pass dkdomain=lunn.ch dmarc=pass fromdomain=lunn.ch); spf=pass (google.com: domain of linux-kernel+bounces-50212-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50212-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=lunn.ch Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 191251F24629 for ; Fri, 2 Feb 2024 17:10:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 37C8B14C59D; Fri, 2 Feb 2024 17:08:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b="CFz4Mlp0" Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A93AF7CF04; Fri, 2 Feb 2024 17:08:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=156.67.10.101 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706893728; cv=none; b=ga281wioI9vu573/Nt9PAhzIiKINVI7A65CUUgegMBB7GzF80P7dVF0mEv10+eqQGtMWZdp7i76VEAtGaeVMEGp5t7D/xRcTyeIiwh82OeZY/Yv3scNnbv61KIlxnoHD7ihsd12r0MFWmIJ/7PZVHpJMhIFUQDy7uoq2T/C335g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706893728; c=relaxed/simple; bh=BrNCrKllmegxbiAtsW/MTJ3MKAd683ma6biQRAVn/0Y=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=E03Cve86pEjKkme9z3pF9h9RXkXy4EkNGLfE936/USbebbw7ez1S8H7vsQpzTMv4U+0viqa56//pp5yWFUfXvoq93Pm2XyZWEk6CUlR2EXtqePj451TihCWt+GLwZcauajh274UnBd+aKAAmRhlttib5pSbYPqArw4OeiHis9ms= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.b=CFz4Mlp0; arc=none smtp.client-ip=156.67.10.101 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=xBboSvhnv3xL8BrH5HURwKtLYk60Bcq74cRcWVNCjGA=; b=CFz4Mlp0R2QPm1LuWWqEYlmurt KeWk7Kt7lKCnxpdSMNegCUdYuSC/VCvVSOVEDRUyvBdHD4kewt1/dYHYjXjkO5nHnnK5AJKqTkGDS iR7UPigbinAu9DR0uPCzF4g6xje7RLtPWdjpPJHs5up1TcRwd2bdLY7qppGtrgrEITAs=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1rVx1l-006pRv-U3; Fri, 02 Feb 2024 18:08:33 +0100 Date: Fri, 2 Feb 2024 18:08:33 +0100 From: Andrew Lunn To: Christian Marangi Cc: "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Konrad Dybcio , Heiner Kallweit , Russell King , Frank Rowand , Robert Marko , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org Subject: Re: [net-next PATCH v5 9/9] net: phy: qca807x: add support for configurable LED Message-ID: <8bbff46a-f316-49b7-82f8-44dbdd452b0d@lunn.ch> References: <20240201151747.7524-1-ansuelsmth@gmail.com> <20240201151747.7524-10-ansuelsmth@gmail.com> <46085abf-8e82-4fd9-95b8-95cbfde6e5c2@lunn.ch> <65bd1af9.df0a0220.c0618.9f8d@mx.google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <65bd1af9.df0a0220.c0618.9f8d@mx.google.com> On Fri, Feb 02, 2024 at 05:40:21PM +0100, Christian Marangi wrote: > On Fri, Feb 02, 2024 at 02:43:37AM +0100, Andrew Lunn wrote: > > > + > > > + phydev->drv->led_brightness_set = NULL; > > > + phydev->drv->led_blink_set = NULL; > > > + phydev->drv->led_hw_is_supported = NULL; > > > + phydev->drv->led_hw_control_set = NULL; > > > + phydev->drv->led_hw_control_get = NULL; > > > > I don't see how that works. You have multiple PHYs using this > > driver. Some might have LEDs, some might have GPOs. But if you modify > > the driver structure like this, you prevent all PHYs from having LEDs, > > and maybe cause a Opps if a PHY device has already registered its > > LEDs? > > > > God you are right! Off-topic but given the effects this may cause, why > the thing is not const? I would like it to be, but its not easy. There are fields in the driver structure that phylib needs to modify. e.g. mdiodrv.driver gets passed to the driver core when registering the driver, and it modifies it. mdiodrv.flags is also manipulated. So we cannot make the whole structure const. Andrew