From nobody Sun Dec 14 12:17:26 2025 Received: from mail-ej1-f49.google.com (mail-ej1-f49.google.com [209.85.218.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 6418F30216F for ; Wed, 10 Dec 2025 08:31:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.218.49 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765355519; cv=none; b=T1f19Pj3shSyFtlFnTKbue2KvOsqouAiu8o2yh9qhPoTDrN2XYvTSFvDNLIYPhCAkgp7ILNLrXzBfTBympxBW1sK1beVH2P6ffVoLUtJrpgGsaGNzZhFIJEi+o/FamrBDk0AWS/3Rp20NdQ+fOlL4MWEIeEe6LNlp4KrE303H4o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765355519; c=relaxed/simple; bh=FFNspWcgr6JBh3jF6KiuWIJwLT9QVchWO/Z3r4hqr+s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=h1CiRMRYAYMhObZeKf78uq/5XVSV+egpFC1wUWiscA4u1LEAOWidWzaLZZBlgdrp8XlPQINasRdCKQecsGxvLZPVoOjkroRDFl1cp6LPJJbr1b79y9/InpDXBiW+RhZttJ61NGavmHHYGsPU9fuAJLapcWQDGCp1mOWKHA0BboY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=cF0BEjQb; arc=none smtp.client-ip=209.85.218.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="cF0BEjQb" Received: by mail-ej1-f49.google.com with SMTP id a640c23a62f3a-b75c7cb722aso1054876766b.1 for ; Wed, 10 Dec 2025 00:31:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1765355513; x=1765960313; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lSMdgZiYQlpcrCoz/a1I+Tk8d9M7yHxRNKGn/fSx/9c=; b=cF0BEjQb+pTEHhzIg1eJMLMIX8DydObzAgCGq3MbMZONR3gBxvoTVTn18tW/DtS+BF YJ6SQThIszXytIBMVK0xujqHuocRfFhNrvlRDYJ3kC8MGLNiuoJcpdms29NkFgK42wfy EXdBwa8XRxpdmSkzApbEZHa+Dnumu5vnxFDxkCx3P2hxaU1dgtgUOxNuxb14HoP8VizS TyvA6l24P4XBbHeNwdBnYvZjOBGzCb+vD5izgNO8JrFY0Ez7q6YpEcLzHrCKPlMHsWcw z2koF1GtH3nj9p2fxVwViw0C2MmHAC6ZnuB+UOPQDbE89avAbYCLBkKd1sIOqSgFtRYf cVgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765355513; x=1765960313; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=lSMdgZiYQlpcrCoz/a1I+Tk8d9M7yHxRNKGn/fSx/9c=; b=BcaDeztTP+Ap/YyGsG6acSmR/eExgKRH1i1F411YCl668n44fhiDts1qXWO3+oEdZ4 W9Gn8VHtZMVG1i1u8Ua7esmQ43FCUmGD6r9SSwdZF7RxiF0KbHt6hRbfpJS65jij2Hxz i8LmjV4rGC9E+/nRJ47kTjwQwKRhmWarCgQOdC0LaZjchvDpGX+l1miSon7toNasfx6R 5PwkCim8R9ms6QgyxE6sLEP2hz2XbD8evXRiG3nfpjiLO/iWbfJHFH336FD+ZiCo/K05 RAx/EqR4n6+KRLstyIuaTfpj/j90gm9nVGe9IO4a07yMiQhqPzVDQxgIe+6xHmXxpsPE MEUg== X-Forwarded-Encrypted: i=1; AJvYcCXpHCwjsfT8YFP44IjeZMb3BcxjalNY1/Y4QrRF3Ayp76ZyAMB+l5k1c+8wueW3JB7ccYFbqdbiM2A4ig0=@vger.kernel.org X-Gm-Message-State: AOJu0Yy2r3ZEGIY/0mGdLdSBi6mbaK7RXbWvX4A10LEpnweNDU0hb/f+ xRkRcbjzuke0ae3llfdPzO/kj7oYOtLfWjWRHuB9PSBUkqEYCSZ5zA85t4ld29DVhd4= X-Gm-Gg: AY/fxX4UekfvsNTG5vYSqSrOeRA+bkkbt4mXxhOWS57KyZiX0rqc09USya8oU0KAhMg ifs44/rz6nwwUY4RMtSwcIlfo4evzI42pyHQuyiRcGRkpiCqA+pCFlJBm8DZ5i8sdoWo+hyCiLE qmdMTTgrfdMczR7EzHHTpvnN1wAXpDItck6531OEuELjbEM9XHP18UgQph06jle7ATFHDuZ8W+Q DyhkTsEA0IOiJfm/NaXg0ssro21G7yn4s6/grCYGPeaJG4APGc9oqTdZAJILJBwd8gpgseiP7Yb mOhwu8zj1Z/sFjzOC0E0b0570JITWWwXcrw+JjyzoAxzihH51cWmziFySpY74clzzOuc8L7kget Z+d4H/MQlJYVvKiO8erFWMM3LFMymWVNPsWqdrneCzQqqjiDnW/1rWV19XuLmCRci9QqM1Lnlcv bo5dqnJiadHH+/Ig3K X-Google-Smtp-Source: AGHT+IFYDRtX5PoiZPxafkMiANC8Xf6Bj78BEbFQEysHNafXsqKHXNdBL6htv855tq3hOMwvxyT2DQ== X-Received: by 2002:a17:906:dc89:b0:b7a:1b3:5e52 with SMTP id a640c23a62f3a-b7ce8245e92mr181408966b.17.1765355513484; Wed, 10 Dec 2025 00:31:53 -0800 (PST) Received: from localhost ([2a02:8071:b783:6940:1d24:d58d:2b65:c291]) by smtp.gmail.com with UTF8SMTPSA id a640c23a62f3a-b79f4975c56sm1602897366b.33.2025.12.10.00.31.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Dec 2025 00:31:53 -0800 (PST) From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= To: Akhil R , Herbert Xu , "David S. Miller" , Thierry Reding , Jonathan Hunter , Mikko Perttunen , David Airlie , Simona Vetter , Sowjanya Komatineni , Luca Ceresoli , Mauro Carvalho Chehab , Greg Kroah-Hartman Cc: linux-crypto@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-media@vger.kernel.org, linux-staging@lists.linux.dev Subject: [PATCH 2/2] host1x: Convert to bus methods Date: Wed, 10 Dec 2025 09:31:38 +0100 Message-ID: X-Mailer: git-send-email 2.47.3 In-Reply-To: References: 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="utf-8" X-Developer-Signature: v=1; a=openpgp-sha256; l=3411; i=u.kleine-koenig@baylibre.com; h=from:subject:message-id; bh=FFNspWcgr6JBh3jF6KiuWIJwLT9QVchWO/Z3r4hqr+s=; b=owGbwMvMwMXY3/A7olbonx/jabUkhkxL/XeniljWpVlqZprUz387O3yFDZsen0Dv82P2G2Sm3 TlnKlbUyWjMwsDIxSArpshi37gm06pKLrJz7b/LMINYmUCmMHBxCsBEVC3Y/zu/fWz+PrXm6LS0 dE5ho5k693/XWU84d3BxsdDGBK8J1dxsNlGXf78pl87kPVPNdPVFGHN/poPqz/XF2R+y4+P+1Pm uF4y9sNcp+StnnJ+woIjkh4kejO9X8ru5rza4Jv51C38E74xrNc+9+s/5tdZ2eKV8MPe/cbB8iu cJA8ud7316C22vnJ8Va705o+iMduCiwGk7jKrzVOL++s14Lv+wt93cRPTHzfK2Ob1enG0Va8y73 AR/zb+W8Z1zSvTLS2YKRjzB/H1W97rMXDljNyk1tquedzktlBzCnO2smc3YUKHdeTDPcUruiQf6 sUVfGVMl1taKv/g0yShu35X6slxd4de/9vOe3K3QXAYA X-Developer-Key: i=u.kleine-koenig@baylibre.com; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: quoted-printable The callbacks .probe(), .remove() and .shutdown() for device_drivers should go away. So migrate to bus methods. There are two differences that need addressing: - The bus remove callback returns void while the driver remove callback returns int (the actual value is ignored by the core). - The bus shutdown callback is also called for unbound devices, so an additional check for dev->driver !=3D NULL is needed. Signed-off-by: Uwe Kleine-K=C3=B6nig --- drivers/gpu/host1x/bus.c | 67 ++++++++++++++++++++-------------------- 1 file changed, 33 insertions(+), 34 deletions(-) diff --git a/drivers/gpu/host1x/bus.c b/drivers/gpu/host1x/bus.c index fd89512d4488..c0d7a9b5f07a 100644 --- a/drivers/gpu/host1x/bus.c +++ b/drivers/gpu/host1x/bus.c @@ -346,6 +346,36 @@ static int host1x_device_uevent(const struct device *d= ev, return 0; } =20 +static int host1x_device_probe(struct device *dev) +{ + struct host1x_driver *driver =3D to_host1x_driver(dev->driver); + struct host1x_device *device =3D to_host1x_device(dev); + + if (driver->probe) + return driver->probe(device); + + return 0; +} + +static void host1x_device_remove(struct device *dev) +{ + struct host1x_driver *driver =3D to_host1x_driver(dev->driver); + struct host1x_device *device =3D to_host1x_device(dev); + + if (driver->remove) + driver->remove(device); +} + +static void host1x_device_shutdown(struct device *dev) +{ + struct host1x_driver *driver =3D to_host1x_driver(dev->driver); + struct host1x_device *device =3D to_host1x_device(dev); + + if (dev->driver && driver->shutdown) + driver->shutdown(device); +} + + static const struct dev_pm_ops host1x_device_pm_ops =3D { .suspend =3D pm_generic_suspend, .resume =3D pm_generic_resume, @@ -359,6 +389,9 @@ const struct bus_type host1x_bus_type =3D { .name =3D "host1x", .match =3D host1x_device_match, .uevent =3D host1x_device_uevent, + .probe =3D host1x_device_probe, + .remove =3D host1x_device_remove, + .shutdown =3D host1x_device_shutdown, .pm =3D &host1x_device_pm_ops, }; =20 @@ -611,37 +644,6 @@ int host1x_unregister(struct host1x *host1x) return 0; } =20 -static int host1x_device_probe(struct device *dev) -{ - struct host1x_driver *driver =3D to_host1x_driver(dev->driver); - struct host1x_device *device =3D to_host1x_device(dev); - - if (driver->probe) - return driver->probe(device); - - return 0; -} - -static int host1x_device_remove(struct device *dev) -{ - struct host1x_driver *driver =3D to_host1x_driver(dev->driver); - struct host1x_device *device =3D to_host1x_device(dev); - - if (driver->remove) - driver->remove(device); - - return 0; -} - -static void host1x_device_shutdown(struct device *dev) -{ - struct host1x_driver *driver =3D to_host1x_driver(dev->driver); - struct host1x_device *device =3D to_host1x_device(dev); - - if (driver->shutdown) - driver->shutdown(device); -} - /** * host1x_driver_register_full() - register a host1x driver * @driver: host1x driver @@ -672,9 +674,6 @@ int host1x_driver_register_full(struct host1x_driver *d= river, =20 driver->driver.bus =3D &host1x_bus_type; driver->driver.owner =3D owner; - driver->driver.probe =3D host1x_device_probe; - driver->driver.remove =3D host1x_device_remove; - driver->driver.shutdown =3D host1x_device_shutdown; =20 return driver_register(&driver->driver); } --=20 2.47.3