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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id EBD9FC38142 for ; Fri, 27 Jan 2023 13:17:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=jYBGhs9aVosAHdgJHexLiICRktQNjm11gG2lWnHQF5A=; b=fwXikv6GkdHKVU EeLviDDX+hwcvwhIb/3GtrnA0amHTKELqZR9cE5xgik8du7DLmnC8Jo482m8w8dyuHOoY0O1LWDWO 7pZZimH6U4caAy23DPLCOJ53WZW2YGq7w9br9paQhIkV8eGXjBkZijSQZxs3oiZotSjhOT44t2j4L GLbgdjDrQVT0Rui83htqNmQaLNZERghJqaOtSGrgcd7+VqvP9pKvCNHzXgdKWMZ5REBuClDDSNd0H 63EcRkYY1C98DenDTz2XoNvtw2nh+EUN1VZB8L0GEqcHuzRuyCtrGekI3BZHQ8BYJKgeZf/+vuS5C KYGpytRZozBF9r3cYw3Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pLOa2-00Ev4G-3C; Fri, 27 Jan 2023 13:15:48 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pLNvc-00EaML-MF for linux-arm-kernel@lists.infradead.org; Fri, 27 Jan 2023 12:34:05 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id EE15C61B94; Fri, 27 Jan 2023 12:33:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CA3CDC433D2; Fri, 27 Jan 2023 12:33:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1674822839; bh=TS2+CpKa2cp61H4L2xyxqqO1Xa+9EPd/tgoYGYbo2PU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=AOIO/dmBppqhBtGmbssqspC6gF08zWXRP3blx3PpWb0QrYlXVWOIZA8xnJc3C+eWu 5kyaDq09s3nJoxaQTN1VT1ciyn4JxcwsT9/Jl/kmN/S2+jN0xhoMHwTeCOCpIUG7wd bvY4O/P0xk2eSogKpMu0lC1ZQFj2jr5pjAoJdOX4= Date: Fri, 27 Jan 2023 13:33:56 +0100 From: Greg Kroah-Hartman To: Rob Herring Cc: linux-kernel@vger.kernel.org, Michael Ellerman , Nicholas Piggin , Christophe Leroy , Chen-Yu Tsai , Jernej Skrabec , Samuel Holland , David Airlie , Daniel Vetter , Benjamin Herrenschmidt , Frank Rowand , Liang He , Thomas Gleixner , Christophe JAILLET , Thomas Zimmermann , Dmitry Baryshkov , Douglas Anderson , Lyude Paul , Corentin Labbe , Zou Wei , linuxppc-dev@lists.ozlabs.org, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, dri-devel@lists.freedesktop.org, devicetree@vger.kernel.org Subject: Re: [PATCH v2 01/16] of: device: make of_device_uevent_modalias() take a const device * Message-ID: References: <20230111113018.459199-1-gregkh@linuxfoundation.org> <20230111113018.459199-2-gregkh@linuxfoundation.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230127_043400_805081_1375A6D1 X-CRM114-Status: GOOD ( 20.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jan 11, 2023 at 08:54:04AM -0600, Rob Herring wrote: > On Wed, Jan 11, 2023 at 5:30 AM Greg Kroah-Hartman > wrote: > > > > of_device_uevent_modalias() does not modify the device pointer passed to > > it, so mark it constant. In order to properly do this, a number of > > busses need to have a modalias function added as they were attempting to > > just point to of_device_uevent_modalias instead of their bus-specific > > modalias function. This is fine except if the prototype for a bus and > > device type modalias function diverges and then problems could happen. To > > prevent all of that, just wrap the call to of_device_uevent_modalias() > > directly for each bus and device type individually. > > Why not just put the wrapper function in the DT code instead of making > 4 copies of it? Ok, I looked at doing this today, but in the end, making "4" copies of this is simpler overall. To do it your way would require a "const" version of the function be added to the core, and then convert these 4 busses to use that, and then when the real function is converted to be const, move all of these functions back over to use that again. Lots of churn, and then in the end, we still have the mismatch of a the same function callback being used in two different types of callbacks (one a bus, one a class). This way we separate them to make things much more obvious and self-contained. So I'll keep this as-is for now, thanks. greg k-h _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel