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 phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id D936BC001DC for ; Mon, 31 Jul 2023 17:23:06 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 13EFB866DA; Mon, 31 Jul 2023 19:23:05 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20221208.gappssmtp.com header.i=@baylibre-com.20221208.gappssmtp.com header.b="ZJQLk/iq"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 3EB668699C; Mon, 31 Jul 2023 19:23:04 +0200 (CEST) Received: from mail-wr1-x432.google.com (mail-wr1-x432.google.com [IPv6:2a00:1450:4864:20::432]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id A3BCB866DA for ; Mon, 31 Jul 2023 19:23:01 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=mkorpershoek@baylibre.com Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-31759e6a4a1so4282723f8f.3 for ; Mon, 31 Jul 2023 10:23:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20221208.gappssmtp.com; s=20221208; t=1690824181; x=1691428981; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=6/w9i/ABj5K51YmB3GYLnKVquZXyBiGmHVqEAU1QQ+I=; b=ZJQLk/iqt68vBi8Nt+TDP/2+NFSMhN6tCV1+vLOAakCwjpGOMEtFnLnTl73Er29paR X6mE8K1Len1H99KqVtRsFu6PfI9I70IT2sLfx0kEHNVTtM4ySLREtoAISukQghKVoRh/ N5U6tIRQu0k9NiYHQog37GxlIEnzL1HQpIa47rwl5s0S35lAXJZRNIn6e1dQBbKVXGsI 5Td99J1zKGA0tShHXMtqceNnH+L8qGHWs75I2MAIa0wgNdsNAcfi6/pNj0SKJUzimbcE wGC2itLeJ5gVwmwLLkdj8hu/Odr2eRj3PFWo1qSxnvr2C479KY3zS2doorAPp7eI6pWT 5iiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690824181; x=1691428981; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=6/w9i/ABj5K51YmB3GYLnKVquZXyBiGmHVqEAU1QQ+I=; b=ZBHpdLKJvpjivfviB5mS3zWzeP7E6XxpzcdolYlKYyJNZiMtNxzDMzoepkB5TXWMA4 Wa7fWky3oCk3cvGK0O9yUnNPcjTe6d7UJs2ZnZuK4d6vSNclCvk/bD//t1wT/VTeQnR/ 6nJWKi0AZb6bpTxEw6dg1tpkzwsf3I4gSQBrbLGvvZW36Ktk/LVaVzuFnvsvpaQelrTC T5SCrM84O3O94PnBe/fAhz2G3+ke4M0wotWLFZNVRRwEYuWX2+Kb6z7pjWCWStPbN5/v O4S1NnuRO/x+fMyDoP8KrAodRuIwD9UnDFUPxauBkZ0spiAExr92pzwp0VHSSBMDxsb5 Iq3g== X-Gm-Message-State: ABy/qLYrqu/LRvSSj5464G7xYnxJwFYOUxWx6DDW9ZrTxzWGxNEfHtpe rOPjHxIBTw/FeKeYJ9jAVupdwg== X-Google-Smtp-Source: APBJJlHsk3DbrA9uR62IItFjkWxHBut7bioPuJLeSbgah6AcK0g4tYnSVmbCL5647CKxnY7nRVmABw== X-Received: by 2002:a5d:658a:0:b0:317:4a0b:c4db with SMTP id q10-20020a5d658a000000b003174a0bc4dbmr295578wru.71.1690824180891; Mon, 31 Jul 2023 10:23:00 -0700 (PDT) Received: from localhost ([2a01:cb19:85e6:1900:2bf7:7388:731d:c4e1]) by smtp.gmail.com with ESMTPSA id z7-20020a5d4407000000b0031766e99429sm13602970wrq.115.2023.07.31.10.23.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 10:23:00 -0700 (PDT) From: Mattijs Korpershoek To: Simon Glass , U-Boot Mailing List Cc: Bin Meng , Simon Glass , Jaehoon Chung , Marek Vasut , Peng Fan Subject: Re: [PATCH v2 4/9] bootstd: Rename bootdev_setup_sibling_blk() In-Reply-To: <20230730171531.914677-4-sjg@chromium.org> References: <20230730171531.914677-1-sjg@chromium.org> <20230730171531.914677-4-sjg@chromium.org> Date: Mon, 31 Jul 2023 19:22:59 +0200 Message-ID: <87h6pk2dxo.fsf@baylibre.com> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean On dim., juil. 30, 2023 at 11:15, Simon Glass wrote: > This name is a little confusing since it suggests that it sets up the > sibling block device. In fact it sets up a bootdev for it. Rename the > function to make this clearer. > > Signed-off-by: Simon Glass Reviewed-by: Mattijs Korpershoek > --- > > Changes in v2: > - Fix the function name in the header as well > > boot/bootdev-uclass.c | 8 +++++--- > common/usb_storage.c | 2 +- > doc/develop/bootstd.rst | 4 ++-- > drivers/mmc/mmc-uclass.c | 2 +- > drivers/nvme/nvme.c | 2 +- > drivers/scsi/scsi.c | 2 +- > drivers/virtio/virtio-uclass.c | 2 +- > include/bootdev.h | 10 +++++----- > 8 files changed, 17 insertions(+), 15 deletions(-) > > diff --git a/boot/bootdev-uclass.c b/boot/bootdev-uclass.c > index 9660ff75676d..114853ffb72a 100644 > --- a/boot/bootdev-uclass.c > +++ b/boot/bootdev-uclass.c > @@ -262,7 +262,7 @@ static int bootdev_get_suffix_start(struct udevice *dev, const char *suffix) > return len; > } > > -int bootdev_setup_sibling_blk(struct udevice *blk, const char *drv_name) > +int bootdev_setup_for_sibling_blk(struct udevice *blk, const char *drv_name) > { > struct udevice *parent, *dev; > char dev_name[50]; > @@ -305,7 +305,9 @@ int bootdev_get_sibling_blk(struct udevice *dev, struct udevice **blkp) > if (device_get_uclass_id(dev) != UCLASS_BOOTDEV) > return -EINVAL; > > - /* This should always work if bootdev_setup_sibling_blk() was used */ > + /* > + * This should always work if bootdev_setup_for_sibling_blk() was used > + */ > len = bootdev_get_suffix_start(dev, ".bootdev"); > ret = device_find_child_by_namelen(parent, dev->name, len, &blk); > if (ret) { > @@ -335,7 +337,7 @@ static int bootdev_get_from_blk(struct udevice *blk, struct udevice **bootdevp) > if (device_get_uclass_id(blk) != UCLASS_BLK) > return -EINVAL; > > - /* This should always work if bootdev_setup_sibling_blk() was used */ > + /* This should always work if bootdev_setup_for_sibling_blk() was used */ > len = bootdev_get_suffix_start(blk, ".blk"); > snprintf(dev_name, sizeof(dev_name), "%.*s.%s", len, blk->name, > "bootdev"); > diff --git a/common/usb_storage.c b/common/usb_storage.c > index ac6427577379..85774220ef2a 100644 > --- a/common/usb_storage.c > +++ b/common/usb_storage.c > @@ -246,7 +246,7 @@ static int usb_stor_probe_device(struct usb_device *udev) > if (ret) > return ret; > > - ret = bootdev_setup_sibling_blk(dev, "usb_bootdev"); > + ret = bootdev_setup_for_sibling_blk(dev, "usb_bootdev"); > if (ret) { > int ret2; > > diff --git a/doc/develop/bootstd.rst b/doc/develop/bootstd.rst > index 7a2a69fdfcec..ec3136535783 100644 > --- a/doc/develop/bootstd.rst > +++ b/doc/develop/bootstd.rst > @@ -306,7 +306,7 @@ media device:: > > The bootdev device is typically created automatically in the media uclass' > `post_bind()` method by calling `bootdev_setup_for_dev()` or > -`bootdev_setup_sibling_blk()`. The code typically something like this:: > +`bootdev_setup_for_sibling_blk()`. The code typically something like this:: > > /* dev is the Ethernet device */ > ret = bootdev_setup_for_dev(dev, "eth_bootdev"); > @@ -316,7 +316,7 @@ The bootdev device is typically created automatically in the media uclass' > or:: > > /* blk is the block device (child of MMC device) > - ret = bootdev_setup_sibling_blk(blk, "mmc_bootdev"); > + ret = bootdev_setup_for_sibling_blk(blk, "mmc_bootdev"); > if (ret) > return log_msg_ret("bootdev", ret); > > diff --git a/drivers/mmc/mmc-uclass.c b/drivers/mmc/mmc-uclass.c > index 01d9b0201f2c..0e157672eae0 100644 > --- a/drivers/mmc/mmc-uclass.c > +++ b/drivers/mmc/mmc-uclass.c > @@ -421,7 +421,7 @@ int mmc_bind(struct udevice *dev, struct mmc *mmc, const struct mmc_config *cfg) > mmc->cfg = cfg; > mmc->priv = dev; > > - ret = bootdev_setup_sibling_blk(bdev, "mmc_bootdev"); > + ret = bootdev_setup_for_sibling_blk(bdev, "mmc_bootdev"); > if (ret) > return log_msg_ret("bootdev", ret); > > diff --git a/drivers/nvme/nvme.c b/drivers/nvme/nvme.c > index a7add66ab4d1..20dc910d8a33 100644 > --- a/drivers/nvme/nvme.c > +++ b/drivers/nvme/nvme.c > @@ -910,7 +910,7 @@ int nvme_init(struct udevice *udev) > if (ret) > goto free_id; > > - ret = bootdev_setup_sibling_blk(ns_udev, "nvme_bootdev"); > + ret = bootdev_setup_for_sibling_blk(ns_udev, "nvme_bootdev"); > if (ret) > return log_msg_ret("bootdev", ret); > > diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c > index 6caeb3fcdd0d..0a3420b7fbc2 100644 > --- a/drivers/scsi/scsi.c > +++ b/drivers/scsi/scsi.c > @@ -607,7 +607,7 @@ static int do_scsi_scan_one(struct udevice *dev, int id, int lun, bool verbose) > /* TODO: undo create */ > return log_msg_ret("pro", ret); > > - ret = bootdev_setup_sibling_blk(bdev, "scsi_bootdev"); > + ret = bootdev_setup_for_sibling_blk(bdev, "scsi_bootdev"); > if (ret) > return log_msg_ret("bd", ret); > > diff --git a/drivers/virtio/virtio-uclass.c b/drivers/virtio/virtio-uclass.c > index 31bb21c534e5..87323ab6d193 100644 > --- a/drivers/virtio/virtio-uclass.c > +++ b/drivers/virtio/virtio-uclass.c > @@ -248,7 +248,7 @@ static int virtio_uclass_post_probe(struct udevice *udev) > device_set_name_alloced(vdev); > > if (uc_priv->device == VIRTIO_ID_BLOCK && !IS_ENABLED(CONFIG_SANDBOX)) { > - ret = bootdev_setup_sibling_blk(vdev, "virtio_bootdev"); > + ret = bootdev_setup_for_sibling_blk(vdev, "virtio_bootdev"); > if (ret) > return log_msg_ret("bootdev", ret); > } > diff --git a/include/bootdev.h b/include/bootdev.h > index 1533adfe5065..848233187f87 100644 > --- a/include/bootdev.h > +++ b/include/bootdev.h > @@ -371,7 +371,7 @@ int bootdev_next_prio(struct bootflow_iter *iter, struct udevice **devp); > /** > * bootdev_setup_for_dev() - Bind a new bootdev device (deprecated) > * > - * Please use bootdev_setup_sibling_blk() instead since it supports multiple > + * Please use bootdev_setup_for_sibling_blk() instead since it supports multiple > * (child) block devices for each media device. > * > * Creates a bootdev device as a child of @parent. This should be called from > @@ -386,7 +386,7 @@ int bootdev_next_prio(struct bootflow_iter *iter, struct udevice **devp); > int bootdev_setup_for_dev(struct udevice *parent, const char *drv_name); > > /** > - * bootdev_setup_for_blk() - Bind a new bootdev device for a blk device > + * bootdev_setup_for_sibling_blk() - Bind a new bootdev device for a blk device > * > * Creates a bootdev device as a sibling of @blk. This should be called from > * the driver's bind() method or its uclass' post_bind() method, at the same > @@ -398,7 +398,7 @@ int bootdev_setup_for_dev(struct udevice *parent, const char *drv_name); > * @drv_name: Name of bootdev driver to bind > * Return: 0 if OK, -ve on error > */ > -int bootdev_setup_sibling_blk(struct udevice *blk, const char *drv_name); > +int bootdev_setup_for_sibling_blk(struct udevice *blk, const char *drv_name); > > /** > * bootdev_get_sibling_blk() - Locate the block device for a bootdev > @@ -428,8 +428,8 @@ static inline int bootdev_setup_for_dev(struct udevice *parent, > return 0; > } > > -static inline int bootdev_setup_sibling_blk(struct udevice *blk, > - const char *drv_name) > +static inline int bootdev_setup_for_sibling_blk(struct udevice *blk, > + const char *drv_name) > { > return 0; > } > -- > 2.41.0.487.g6d72f3e995-goog