Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1315287pxm; Thu, 24 Feb 2022 00:12:33 -0800 (PST) X-Google-Smtp-Source: ABdhPJyKS9akm9rYg7xBlKvsqBBjWxiISIEYMxk8GiGr2ySGmtxk0OGkKzP07qbOYdwMFdOBbLFb X-Received: by 2002:a05:6402:354a:b0:412:8976:82d2 with SMTP id f10-20020a056402354a00b00412897682d2mr1203692edd.213.1645690353245; Thu, 24 Feb 2022 00:12:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645690353; cv=none; d=google.com; s=arc-20160816; b=FBRvB8fxT3xHd+UAPtsxIpZDjcQsqaN0mm5rVAFKet0Jbu/JwafFIvXF04cX2MsCcm GX8yy8A74ah2/CeaebwAhlKJIe23GYD1ctJYoqegTnC9sA3VAXqC1zI5g19aPY0iI9nC EM2lPqCyn4LusraDJZDGhS2fj+4/gNKjfPsaTIh6cYeaLy4sfloSvUuQ+nahWvNJpmZR bWLSoJ5Ebgitp3o2CvPKmk4iMuoqEvyClU4X3JFqwpUTZCJ26MlfCqnzOHlteniiOzCu QjlLpiODto6mcHKzCMY+9xpdmR3xMBA05SUR4VCW/CkAJC2HscdpptFNyRrA+x41q5qv rDXw== 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=Zs4sP9i99NlTTPrJcg2NREY6h9bovqrYIvzZODv1Ymc=; b=Tlo5s+FeOA+b45IZRPEQEkx07j+2+D/1x0vEcCnyt43dXP449zre2DJmzCyNcaNgR+ i0XTCgghIDTQEHZjw1r5kzu4iL//USvpl8BZO4r7PdcYFOyjdO3Hl2KY+wcnxBS8BLeJ 8wFYwRTkNBfiUMGrqqrjikXBGkQXFTtTCeevnjI/CiaSg+mC9ekrFy1j9n7jwQipclRR ljNtNWWWrXsNDHIM9Uz6D5TGA2oj5ORtqMjto9DTRSgJz1UKLAlLYFcNIyba6cbzpzJe pTelcbrfdqJDYyqueQ7UnaintxvaVnqgEpS1eSOey9hJun62n3VjeUzyQU+kKLEONWgA bVyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@canonical.com header.s=20210705 header.b=FOLRfkbw; 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=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g9si1239193edt.243.2022.02.24.00.12.09; Thu, 24 Feb 2022 00:12:33 -0800 (PST) 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=@canonical.com header.s=20210705 header.b=FOLRfkbw; 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=pass (p=NONE sp=NONE dis=NONE) header.from=canonical.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230120AbiBXHsN (ORCPT + 99 others); Thu, 24 Feb 2022 02:48:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32836 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229908AbiBXHsK (ORCPT ); Thu, 24 Feb 2022 02:48:10 -0500 Received: from smtp-relay-internal-1.canonical.com (smtp-relay-internal-1.canonical.com [185.125.188.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 48DA216FDFD for ; Wed, 23 Feb 2022 23:47:40 -0800 (PST) Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-internal-1.canonical.com (Postfix) with ESMTPS id 28BB53FCAE for ; Thu, 24 Feb 2022 07:47:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1645688857; bh=Zs4sP9i99NlTTPrJcg2NREY6h9bovqrYIvzZODv1Ymc=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=FOLRfkbwBevtyKyaIaEOFJrEcXGlUuMrV7T+AFvZJ+VNvzhDZahpm6TAMUtLHgXMb 9zPZ8obR2juBQi/IS9B1/An8KYNX5Nm3qoKst7P6S1ZNxY1U+zPx+4c2b+rk43hp2s UZVm9IYh+z46DyG0OXuKj4Os2Q34VHZAqympqqiwWSLV5/wV4QzDct+SX8+njHM9nB samjmzwIElDUdgR/OQX7P3w9ng3RUWfWpm31bkzs1BrX+OmW5M0xFLTXyTCl1CRs40 KRp69GEEPSZ8XlDMf1wNPOymrXmKp/QwHJbbQHOTSZFjYTylD9ODo6jmvSIRDOKuZd vlJJz2+eocjAA== Received: by mail-ej1-f69.google.com with SMTP id nb1-20020a1709071c8100b006d03c250b6fso812614ejc.11 for ; Wed, 23 Feb 2022 23:47:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=Zs4sP9i99NlTTPrJcg2NREY6h9bovqrYIvzZODv1Ymc=; b=MnrFiKi66UYDg31sgOx5rIF4iMglOs10yh81v0dE+3QeB2RjKUj3Wz2aEHkuWFi9xF NDsVummnBcYbO9NVGihfoEy8B0GO1b5kAKaTEjlmATs3TilUqNNrh+80ZzuL0Z99PkEC JR3FdJ72ooI2WqEgjhHMejePyTbr7JsDbPOO7nXKcqM3wyepJYlvbBEKZirPkqNUrROL duxwPp0vADrC1ssh4RYsZzVCj2O9o2LJ1JCXZ7ZXcvJreSsDhxIzj6wnz071sdQVn/Rc pwu+pz43MZNFxV6mPqMvSoPmPmZmiMFp+Xn3bQmWmJssgc4kbswvS2tcCNZTYrNkbkMB VWZQ== X-Gm-Message-State: AOAM530392+FnzzEUAyCfWuySaQErBVe+2ckKm2EBm3f9JZ0NNMYfTGt EXtoIVo7BNFqDVA6naze6NMc7MNgrFbfjoln14HX4oqya6ePC6wddVK2JIOaNqILNMl7Z6AKZWp hH+nRvO0nf2Yz2OuQfUZAXaaQE35rXuI1bF3xBoSYqg== X-Received: by 2002:a17:906:aed4:b0:6ba:6d27:ac7 with SMTP id me20-20020a170906aed400b006ba6d270ac7mr1258067ejb.33.1645688844793; Wed, 23 Feb 2022 23:47:24 -0800 (PST) X-Received: by 2002:a17:906:aed4:b0:6ba:6d27:ac7 with SMTP id me20-20020a170906aed400b006ba6d270ac7mr1258017ejb.33.1645688844569; Wed, 23 Feb 2022 23:47:24 -0800 (PST) Received: from [192.168.0.127] (xdsl-188-155-181-108.adslplus.ch. [188.155.181.108]) by smtp.gmail.com with ESMTPSA id v30sm942368ejv.76.2022.02.23.23.47.23 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 23 Feb 2022 23:47:24 -0800 (PST) Message-ID: Date: Thu, 24 Feb 2022 08:47:22 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Subject: Re: [PATCH v2 01/11] driver: platform: add and use helper for safer setting of driver_override Content-Language: en-US To: Bjorn Helgaas Cc: Greg Kroah-Hartman , "Rafael J. Wysocki" , Stuart Yoder , Laurentiu Tudor , Abel Vesa , Shawn Guo , Sascha Hauer , Fabio Estevam , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Wei Liu , Dexuan Cui , Bjorn Helgaas , Bjorn Andersson , Mathieu Poirier , Vineeth Vijayan , Peter Oberparleiter , Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Andy Gross , Srinivas Kandagatla , Mark Brown , "Michael S. Tsirkin" , Jason Wang , linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org, NXP Linux Team , linux-arm-kernel@lists.infradead.org, linux-hyperv@vger.kernel.org, linux-pci@vger.kernel.org, linux-remoteproc@vger.kernel.org, linux-s390@vger.kernel.org, linux-arm-msm@vger.kernel.org, alsa-devel@alsa-project.org, linux-spi@vger.kernel.org, virtualization@lists.linux-foundation.org, Linus Torvalds , Rasmus Villemoes References: <20220223215342.GA155282@bhelgaas> From: Krzysztof Kozlowski In-Reply-To: <20220223215342.GA155282@bhelgaas> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,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 On 23/02/2022 22:53, Bjorn Helgaas wrote: > On Wed, Feb 23, 2022 at 08:13:00PM +0100, Krzysztof Kozlowski wrote: >> Several core drivers and buses expect that driver_override is a >> dynamically allocated memory thus later they can kfree() it. >> ... > >> + * set_driver_override() - Helper to set or clear driver override. > > Doesn't match actual function name. Good point. I wonder why build W=1 did not complain... I need to check. > >> + * @dev: Device to change >> + * @override: Address of string to change (e.g. &device->driver_override); >> + * The contents will be freed and hold newly allocated override. >> + * @s: NULL terminated string, new driver name to force a match, pass empty >> + * string to clear it >> + * >> + * Helper to setr or clear driver override in a device, intended for the cases >> + * when the driver_override field is allocated by driver/bus code. > > s/setr/set/ Right. Thanks for checking. > >> + * Returns: 0 on success or a negative error code on failure. >> + */ >> +int driver_set_override(struct device *dev, char **override, const char *s) >> +{ Best regards, Krzysztof