From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) (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 BAB501EBA14 for ; Tue, 27 Jan 2026 15:27:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=148.163.156.1 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769527645; cv=none; b=SGddteq304QYsnWgUzrryCUo6/AiDvPMphLnl36WJtAxmFh1bUJK9I5p8i09QBZsZ38PxWxfjOrCuJmyvPo8pbg3gdtGsSUA/+245Z9o3BJ7KjpiDfc/dg3UxoOulFrM/ZMz+VhhphRISJEjHl1P7UD2vVqz8gu7OIO6/TABWc0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1769527645; c=relaxed/simple; bh=2uUv+Oi/f2lGNpwIVeZ02HkUb67SEYKQlg/c2rPT1EI=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=V9tAmPNX9mq80GmUk/IhQAKVOl8lE29b2k/n3OJhJ5T3bqGtTOx6fTNAo6htgOdNuyP5OjuDeBFu4cHzoz/8V3L4Rennm7O4CotdQRSgz5efBtI8KYNJZnL/2Qz8JODbbC7y9pAknXaN6ZF/tGB56Ye+l1e3+XE1Z0cPEcHHpKw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com; spf=pass smtp.mailfrom=linux.ibm.com; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b=AKB6FIuX; arc=none smtp.client-ip=148.163.156.1 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.ibm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ibm.com header.i=@ibm.com header.b="AKB6FIuX" Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 60R723I6013597; Tue, 27 Jan 2026 15:27:20 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=cc :content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=pp1; bh=2pwlo2 fWhhXMyDkaGnvPnrIQy65mgG3fxIcZnMcnF70=; b=AKB6FIuX5TaC1OZRMUr4jn y5Kk3mio2wD5GnuWF0ytn4LQBWI7YgfslSH1T0vlW5fZseCsUqXQyLE0UoQcvRj6 xPX0CQCRWbamvVNWzTzwdqxeQeE3l8rJPEeOm8MzIZAOHCYWxXxhlrcj2r1Z1u0w B8C2wojl9nwyBHTMv9SoiWUvRRvEWDSA09EyDY4G3aCdsQitOrYq7QhIpVsBiKJg QnhGo9HsJhA5wj3e5zGdFn8wFAb20I2Az4gr2l1Xeahy4LSTC5/jDSYoESg4SDYK ORiqhvjP1GeisyJc2Ml+vd/q3pdM00LCb2VWuXd+lxND6bv/u0I+Vgz93tfropEg == Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 4bvnk6x6s6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Jan 2026 15:27:19 +0000 (GMT) Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.18.1.2/8.18.1.2) with ESMTP id 60REptgi017960; Tue, 27 Jan 2026 15:27:18 GMT Received: from smtprelay05.wdc07v.mail.ibm.com ([172.16.1.72]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 4bwb41rw9n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Jan 2026 15:27:18 +0000 Received: from smtpav05.dal12v.mail.ibm.com (smtpav05.dal12v.mail.ibm.com [10.241.53.104]) by smtprelay05.wdc07v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 60RFRH6E31851190 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 27 Jan 2026 15:27:18 GMT Received: from smtpav05.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D406D5805D; Tue, 27 Jan 2026 15:27:17 +0000 (GMT) Received: from smtpav05.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A047858052; Tue, 27 Jan 2026 15:27:17 +0000 (GMT) Received: from [9.61.135.234] (unknown [9.61.135.234]) by smtpav05.dal12v.mail.ibm.com (Postfix) with ESMTP; Tue, 27 Jan 2026 15:27:17 +0000 (GMT) Message-ID: Date: Tue, 27 Jan 2026 09:27:17 -0600 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 07/13] fsi: Create bus specific probe and remove functions To: =?UTF-8?Q?Uwe_Kleine-K=C3=B6nig?= Cc: Ninad Palsule , linux-fsi@lists.ozlabs.org, linux-kernel@vger.kernel.org References: <3b53adb75a5ae7894736d46cb6eb85f5ef36520e.1765279318.git.u.kleine-koenig@baylibre.com> Content-Language: en-US From: Eddie James In-Reply-To: <3b53adb75a5ae7894736d46cb6eb85f5ef36520e.1765279318.git.u.kleine-koenig@baylibre.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: Am54LoK88vKu2S8weiotniVWJbRKFfdg X-Proofpoint-ORIG-GUID: Am54LoK88vKu2S8weiotniVWJbRKFfdg X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMTI3MDEyNSBTYWx0ZWRfX5I9V6OeAGolr vaqhe3wjeOyVSpRG0SXOpx+kdzXKz0rrBFOeYb6NMJJPF4Dd/rLw8fCqMCcFOcgVR5BdjKLJShq EemCQMgY+efAhLxXFxnaMp0f562O3JFwCXuRak8yeg0WFeJFqhlUSRJD+KIy/5R8QLxGezj6jk9 tJbYvpJtexaYJmQp23ZwWXduNtMH081i4y3iMXuZDi5zWUgxq5YwT4wuRMYVaSn6ZxL80yk14az 0tBiqdPYL9QFm/vG/wB6maX2NcRgH7NoDlrM6y2893TLWDFSmHgQAVKDJzlOJYDhNb0f56GRiOu r/ZA0NXOttl7T/RMZKslBFjlJiPUpbqLGnJ7ud7Knh1+REacPL+AYXFL9z3SybbnK4I6XNr9vIi HhhJzVcNfaBqltmjM0i+wkufQmYw6nCu+erzhYxXHXYFKDEOF8W95dzFb59DxU8jhYPfE3lzamj TjZW8/dRkN+31wNnGIw== X-Authority-Analysis: v=2.4 cv=AMiVTGgp c=1 sm=1 tr=0 ts=6978d957 cx=c_pps a=aDMHemPKRhS1OARIsFnwRA==:117 a=aDMHemPKRhS1OARIsFnwRA==:17 a=IkcTkHD0fZMA:10 a=vUbySO9Y5rIA:10 a=VkNPw1HP01LnGYTKEx00:22 a=VnNF1IyMAAAA:8 a=IpJZQVW2AAAA:8 a=OcGNdC3savYypyg_DCMA:9 a=3ZKOabzyN94A:10 a=QEXdDO2ut3YA:10 a=IawgGOuG5U0WyFbmm1f5:22 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-01-27_03,2026-01-27_02,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 spamscore=0 phishscore=0 bulkscore=0 suspectscore=0 adultscore=0 clxscore=1015 priorityscore=1501 lowpriorityscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.19.0-2601150000 definitions=main-2601270125 On 12/9/25 5:40 AM, Uwe Kleine-König wrote: > Introduce a bus specific probe and remove function. For now this only > allows to get rid of a cast of the generic device to an fsi device in > the drivers and changes the remove prototype to return void---a non-zero > return value is ignored anyhow. > > The objective is to get rid of users of struct device callbacks > .probe(), .remove() and .shutdown() to eventually remove these. > > Until all fsi drivers are converted this results in a runtime warning > about the drivers needing an update because there is a bus probe > function and a driver probe function. Acked-by: Eddie James > > Signed-off-by: Uwe Kleine-König > --- > drivers/fsi/fsi-core.c | 50 ++++++++++++++++++++++++++++++++++++++++++ > include/linux/fsi.h | 2 ++ > 2 files changed, 52 insertions(+) > > diff --git a/drivers/fsi/fsi-core.c b/drivers/fsi/fsi-core.c > index 4e60d4b17c11..83599a1c548b 100644 > --- a/drivers/fsi/fsi-core.c > +++ b/drivers/fsi/fsi-core.c > @@ -128,9 +128,31 @@ static int fsi_bus_match(struct device *dev, const struct device_driver *drv) > return 0; > } > > +static int fsi_probe(struct device *dev) > +{ > + struct fsi_device *fsidev = to_fsi_dev(dev); > + struct fsi_driver *fsidrv = to_fsi_drv(dev->driver); > + > + if (fsidrv->probe) > + return fsidrv->probe(fsidev); > + else > + return 0; > +} > + > +static void fsi_remove(struct device *dev) > +{ > + struct fsi_device *fsidev = to_fsi_dev(dev); > + struct fsi_driver *fsidrv = to_fsi_drv(dev->driver); > + > + if (fsidrv->remove) > + fsidrv->remove(fsidev); > +} > + > static const struct bus_type fsi_bus_type = { > .name = "fsi", > .match = fsi_bus_match, > + .probe = fsi_probe, > + .remove = fsi_remove, > }; > > /* > @@ -1392,6 +1414,25 @@ void fsi_master_unregister(struct fsi_master *master) > } > EXPORT_SYMBOL_GPL(fsi_master_unregister); > > +static int fsi_legacy_probe(struct fsi_device *fsidev) > +{ > + struct device *dev = &fsidev->dev; > + struct device_driver *driver = dev->driver; > + > + return driver->probe(dev); > +} > + > +static void fsi_legacy_remove(struct fsi_device *fsidev) > +{ > + struct device *dev = &fsidev->dev; > + struct device_driver *driver = dev->driver; > + int ret; > + > + ret = driver->remove(dev); > + if (unlikely(ret)) > + dev_warn(dev, "Ignoring return value of remove callback (%pe)\n", ERR_PTR(ret)); > +} > + > int fsi_driver_register(struct fsi_driver *fsi_drv) > { > if (!fsi_drv) > @@ -1401,6 +1442,15 @@ int fsi_driver_register(struct fsi_driver *fsi_drv) > > fsi_drv->drv.bus = &fsi_bus_type; > > + /* > + * This driver needs updating. Note that driver_register() warns about > + * this, so we're not adding another warning here. > + */ > + if (!fsi_drv->probe && fsi_drv->drv.probe) > + fsi_drv->probe = fsi_legacy_probe; > + if (!fsi_drv->remove && fsi_drv->drv.remove) > + fsi_drv->remove = fsi_legacy_remove; > + > return driver_register(&fsi_drv->drv); > } > EXPORT_SYMBOL_GPL(fsi_driver_register); > diff --git a/include/linux/fsi.h b/include/linux/fsi.h > index 3e3a8f3adac3..9c67c43f9e6c 100644 > --- a/include/linux/fsi.h > +++ b/include/linux/fsi.h > @@ -49,6 +49,8 @@ struct fsi_device_id { > .engine_type = (t), .version = (v), > > struct fsi_driver { > + int (*probe)(struct fsi_device *fsidev); > + void (*remove)(struct fsi_device *fsidev); > struct device_driver drv; > const struct fsi_device_id *id_table; > };