Received: by 2002:ab2:69cc:0:b0:1fd:c486:4f03 with SMTP id n12csp327363lqp; Tue, 11 Jun 2024 06:02:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX4XW85OFQN7jpDRkJv2Xjl8jN1BZkCQm/kh9KndqZRNSTuSDiBbBXVI59Bod7Au8DjV3NRAHsNqo/q8/fUG60CjxLzMfD61R3qic3apQ== X-Google-Smtp-Source: AGHT+IEL9FR4SBWHioKvcny5iNGltjrax45d/bSuQOR9pU73kWQDBzmiSexAFI8Gu53wNbfiLfm7 X-Received: by 2002:ac8:7d50:0:b0:441:24e:6464 with SMTP id d75a77b69052e-4413abb8cb9mr45892101cf.14.1718110962734; Tue, 11 Jun 2024 06:02:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718110962; cv=pass; d=google.com; s=arc-20160816; b=Ld8JJ4/MiFO9E+pV79W54BL37JJJV/NC5GI2IUBk9Vtw3dfmGjadnWHgiCPvmpIzqX w2KiFyvM0gEjDs5AElp9x7+4D4s2JWZaYOwUTs2Upj44g9SPfJrVRL1zyrPZYf8M6q79 YHFlBB2Prmsb9uT2A/ebbM34F4oAnKqiYViDNqrySUg/U1wefv6q9QCpCl2b71+8vVeR 5D1Xf1vLgG+zJcrWXpy2NAkoxdDraxpUAiAeQR7HyPBxnvgAkgTTb1ch9ZBZ9ZamTCje lAWnh0vXYehTj7GqIjd0SJkKhOQ4vI7qbc4DtvQ7+w+Mv0AXClnlkAAD/vwtBLzsGpm9 Hs4g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=PoAMtxDlufvRbsneA1dujeYPdn/ndSo8Zqaqbb0d01Q=; fh=jUXwtF0520eqoQ34ytTRmHhHfmU9hKCLubTc/MmAv2E=; b=omkGpfs1dlzseyDktH9AuaYxcDVhYkmp+GtmI7wYsha3e15rOSfep1hX/Somo78qo0 ANe8u8xl4qXkrkpUWERdZGgUQcwXYJm8eQZkUfdEZ4FKgENiMUeFlOrSBwttsB0mjVyP /WeXyuXqhTjwOW6zBbDBY25WoLiyqtO0nM12hcXy0zdhR6O+/GO/Ijqpd+ZSg3vzxBbe AilIjrYwLnd7T+O9FymBlNQObS5qGJReRhCVOPKo3iT8sWsLoOcTak3Z8LEJKJXf3H8F EHBvxpWKuzUusFIhPDH9qlZJWZpBY98hwZUmKAYqDIrxGZAYyDlJtnm3g5oj5rzl3kgt NvaQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ExpJfHUt; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-209893-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209893-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id ada2fe7eead31-48d7499e9bdsi898935137.358.2024.06.11.06.02.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 11 Jun 2024 06:02:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-209893-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ExpJfHUt; arc=pass (i=1 dkim=pass dkdomain=linuxfoundation.org); spf=pass (google.com: domain of linux-kernel+bounces-209893-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-209893-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 212921C236E2 for ; Tue, 11 Jun 2024 13:02:10 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8C94717D885; Tue, 11 Jun 2024 13:01:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="ExpJfHUt" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 B892D17D357 for ; Tue, 11 Jun 2024 13:01:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718110887; cv=none; b=basxfu0v9mavOiJT7+4fHPEdRfAk/rCXJc5aRZSWY7oICdpGbC2naPAvwIityI7sfuc4gDkkyEIPSUPXhd1s3CAOjeTRCGQZ7QCtk95UYJfKLaNSInXg9+9OSmB1BBrmYF/IGjECyW87eg5mMY1G7m7W3Eo1wHSb2d30i8Yj8Xo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718110887; c=relaxed/simple; bh=Ewiq4xx5eBrJ6zT/nXIgeEyinKpoSQ+oZEBy9wIt8XA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hLNu3fTp8wkW+CZdsDjeRToQU1ZwIUI9wOCoCXHqfZPOVY9n+KGvEuKiwJU0XMYw/oeYop3tKP0ah2Iiavvkn4ONJWqSNJeVRJZWjVQZqqNR6ZNYXqnAdSz6myb0qmcRKgTAJ5OpmC0Q2ISSk5QwD3/EV0i/K+px2KWtucLk728= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=ExpJfHUt; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E71EAC2BD10; Tue, 11 Jun 2024 13:01:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1718110886; bh=Ewiq4xx5eBrJ6zT/nXIgeEyinKpoSQ+oZEBy9wIt8XA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ExpJfHUtZVpo3xPrxe61mCjd28c9S6PDLKJqYjBXt549dNl0JuXG+A9ETEYZ3ta92 JzrZw476EKyMXQfqqCdAlk0dRuoEYbghtku5f6cWP0S8HI343QjzVnDthp+MdeXteB iHoLdn9dHMhEZqy2tumDYd2T5qggqibr8tL98/dQ= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , "Rafael J. Wysocki" Subject: [PATCH 5/6] driver core: make driver_detach() take a const * Date: Tue, 11 Jun 2024 15:01:08 +0200 Message-ID: <20240611130103.3262749-11-gregkh@linuxfoundation.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240611130103.3262749-7-gregkh@linuxfoundation.org> References: <20240611130103.3262749-7-gregkh@linuxfoundation.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Developer-Signature: v=1; a=openpgp-sha256; l=1951; i=gregkh@linuxfoundation.org; h=from:subject; bh=Ewiq4xx5eBrJ6zT/nXIgeEyinKpoSQ+oZEBy9wIt8XA=; b=owGbwMvMwCRo6H6F97bub03G02pJDGkZXpN+35bSqHKum7PbhdOlpW1hzOmu3/+s+tebTTjaz vLt8cvFHbEsDIJMDLJiiixftvEc3V9xSNHL0PY0zBxWJpAhDFycAjARv9cM82sTD9ulR9Wo3Nnj Ib9YM+iy+YXHvgwL9gs8fZelM3nJpR06Z62aFimrKF4IAwA= X-Developer-Key: i=gregkh@linuxfoundation.org; a=openpgp; fpr=F4B60CC5BF78C2214A313DCB3147D40DDB2DFB29 Content-Transfer-Encoding: 8bit driver_detach() does not modify the driver itself, so make the pointer constant. In doing so, the function driver_allows_async_probing() also needs to be changed so that the pointer type passes through to that function properly. Cc: "Rafael J. Wysocki" Signed-off-by: Greg Kroah-Hartman --- drivers/base/base.h | 2 +- drivers/base/dd.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/base/base.h b/drivers/base/base.h index d332b87cde9e..9df8028c3201 100644 --- a/drivers/base/base.h +++ b/drivers/base/base.h @@ -158,7 +158,7 @@ void bus_remove_driver(struct device_driver *drv); void device_release_driver_internal(struct device *dev, const struct device_driver *drv, struct device *parent); -void driver_detach(struct device_driver *drv); +void driver_detach(const struct device_driver *drv); void driver_deferred_probe_del(struct device *dev); void device_set_deferred_probe_reason(const struct device *dev, struct va_format *vaf); static inline int driver_match_device(struct device_driver *drv, diff --git a/drivers/base/dd.c b/drivers/base/dd.c index c24eca917d41..76b26096b033 100644 --- a/drivers/base/dd.c +++ b/drivers/base/dd.c @@ -863,7 +863,7 @@ static int __init save_async_options(char *buf) } __setup("driver_async_probe=", save_async_options); -static bool driver_allows_async_probing(struct device_driver *drv) +static bool driver_allows_async_probing(const struct device_driver *drv) { switch (drv->probe_type) { case PROBE_PREFER_ASYNCHRONOUS: @@ -1333,7 +1333,7 @@ void device_driver_detach(struct device *dev) * driver_detach - detach driver from all devices it controls. * @drv: driver. */ -void driver_detach(struct device_driver *drv) +void driver_detach(const struct device_driver *drv) { struct device_private *dev_prv; struct device *dev; -- 2.45.2