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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 67C1DC54EBC for ; Wed, 11 Jan 2023 15:31:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231453AbjAKPbG (ORCPT ); Wed, 11 Jan 2023 10:31:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239110AbjAKPa5 (ORCPT ); Wed, 11 Jan 2023 10:30:57 -0500 Received: from mail-lf1-x129.google.com (mail-lf1-x129.google.com [IPv6:2a00:1450:4864:20::129]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64C3526FF for ; Wed, 11 Jan 2023 07:30:56 -0800 (PST) Received: by mail-lf1-x129.google.com with SMTP id f34so24052032lfv.10 for ; Wed, 11 Jan 2023 07:30:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=Qbu6KqoFVUP3hpnWPUahg6+pfccNp1XMgcyJhxL3sHQ=; b=piJ6AR/7mwIv5ssf0bPeGI/y1HfticwRpnHpKDxpJJOmyFI9+Fcte6qtWkH0I2fOxf xTYmiVIlFySN2KbqHCXqxzBIxc6/2nlxu2+ixkY3fDhe2OFDyngzekiuLGrNcgW/Xsu1 xqJdTvSzEIrHX7Hx9YvafGHvvBa4vY2qsZ3b1McEzW5tmaA8Nw9+yNGHiBd8I4QF/H0L PLkaIsFKD8tt7+XUYZ4Z0Jp/RHCbQ3m0OkeG8mkPs1ENMKkoMw8SGGYL4Yuyp+dMY28h Jcy4hVLz8OdUGwq9wRNwLttaNd4at+MPk+3V1lPBjbBePveIBaxuDRkGijEMOSgYcWva gHzA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Qbu6KqoFVUP3hpnWPUahg6+pfccNp1XMgcyJhxL3sHQ=; b=keXP9J/6K7xXifcAOz3u/RBccGtoC+ja2D3k9DzC/AXgShacRDjwmLELT96tzEP+DD MUW8SLN7h5e4QlzqNkqszvV8bVsfh+XoUoKx/Niynj94WS7NBM6h2KOfdLDuxTLp23dd NMGC+42iMGPnpPoENAfEsoXllDo6aTdPln9XA9Ie1ZSFRB/ge2LdD8ce5UKNoMVLmqXJ rKkwuDMSetEZUmsiFdrsOWD7VXLPAoiqDg89MQLGxfxomiFsNYvarYccb5G3HpD9OmKI mwXf2DIhbug+xukNKFOAzJFtqJvdU+sKO98gZoKIkhyeX7WVhSFbqrfZ5SDg3ixjHRom TrZg== X-Gm-Message-State: AFqh2kqQiJF7j1ifB8Ly3CO6aJNThrWDSbrksV+tQFpdWv989bTzxb+a 4BjJcip+yfH7dLyj2UnEVKmOfg== X-Google-Smtp-Source: AMrXdXsJsrNv/JojgqdyGM2htDPuCMqWkk3bmrHNobr84SP2C7Wa10a79dDgSHhARO48zeWm2i9u1A== X-Received: by 2002:ac2:495b:0:b0:4b5:6755:4226 with SMTP id o27-20020ac2495b000000b004b567554226mr19619019lfi.55.1673451054761; Wed, 11 Jan 2023 07:30:54 -0800 (PST) Received: from ?IPV6:2001:14ba:a085:4d00::8a5? (dzccz6yyyyyyyyyyybcwt-3.rev.dnainternet.fi. [2001:14ba:a085:4d00::8a5]) by smtp.gmail.com with ESMTPSA id v23-20020ac258f7000000b004cb00bf6724sm2779947lfo.143.2023.01.11.07.30.53 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 11 Jan 2023 07:30:54 -0800 (PST) Message-ID: <88faa612-e7a0-24b8-aba8-4a42919402ec@linaro.org> Date: Wed, 11 Jan 2023 17:30:53 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH v2 01/16] of: device: make of_device_uevent_modalias() take a const device * Content-Language: en-GB To: Greg Kroah-Hartman , 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 , 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 References: <20230111113018.459199-1-gregkh@linuxfoundation.org> <20230111113018.459199-2-gregkh@linuxfoundation.org> From: Dmitry Baryshkov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org On 11/01/2023 17:26, Greg Kroah-Hartman wrote: > 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? > > I could, if you think that it would be better there instead of in each > individual bus (like all of the other bus callbacks). This way each bus > "owns" their implementation :) I'd vote for the generic wrapper instead of 4 similar wrapper. In the end, if of_device_uevent_modalias (or the bus callback) interface changes again for whatever reasons, there will be just a single place to fix rather than fixing 4 (or more) bus drivers. -- With best wishes Dmitry