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 C3607C0015E for ; Fri, 28 Jul 2023 08:00:42 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4D273866D9; Fri, 28 Jul 2023 10:00:37 +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="cXbOrL0U"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 6248B868A5; Fri, 28 Jul 2023 10:00:33 +0200 (CEST) Received: from mail-wm1-x32a.google.com (mail-wm1-x32a.google.com [IPv6:2a00:1450:4864:20::32a]) (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 A4EBA868B8 for ; Fri, 28 Jul 2023 10:00:18 +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-wm1-x32a.google.com with SMTP id 5b1f17b1804b1-3fbd33a57dcso20542375e9.0 for ; Fri, 28 Jul 2023 01:00:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20221208.gappssmtp.com; s=20221208; t=1690531218; x=1691136018; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc:subject:date:message-id:reply-to; bh=22ZKptvBOeXeAOAuXuepf4Kz/Nch6WQe8uAG6f3jK5M=; b=cXbOrL0UURySxHp/JQ0QsLgKFbk+n78rxK9CAl9De0nHshKfXV86nc75mRIFYFC831 43T4+d7MQ+WP3T6X6DZlaewZ4BXsTREnz0w5bbWGK9HGKqFNG5nSfmE4AuCpMFNYm1k7 d+mMP0V1t3m1vI332aXDtXjd127+6LtR8WAHVziGvKsiJ/43diRcQENLLZa7YzhYKtMK NwQqSYBxF6kBhJ5CQz2btyLiq0mfsYlJN1k7kJm+4899XHKtogu065BEiodopv/kcEZX ZUpUu2hwEPMAqJem1IwUnKwNhP/529JiD2CmRDJk9t6EJ3oGlJ7gRcq9KyagoQsoIDBy nZxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690531218; x=1691136018; 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=22ZKptvBOeXeAOAuXuepf4Kz/Nch6WQe8uAG6f3jK5M=; b=HVEIm3U7PVuYXhnCl1PmfJzVvNzH/sCEHedPN0zq6OOZcOPhb98rRK6oQB4qp00yp6 MqyRVrQ7yjifLKgfOMHLEZKcSm0PN7Bcv7NTMXJVCSBFoBSezLYBmT1mh4Obj/xhjDgR ipEzLSNgG4y+It3gp2QadOTzbrywR76hzapSrJrLn53J/OtoL1euZCEyoHcfGUceGSF2 JSzz0Izfgwrt87r3vSmW/0/HiiplsZILeNofByamZMN1+EY6AayYqEfbtBRGfJl+KTH/ 6NsDmDbdbmsrE1krfAWS9v1fJ6cTSN/ziKUusgzore1q7UFxx7pNLw/EqRmaVbVo+Cd8 aECg== X-Gm-Message-State: ABy/qLbZhrMoZaFhtr5vtgLszgPIhCTiZ5quKYSAi0wCuNBB/j2SEv7n iQ8OCFfNAsKyO8pywh4MPxSW7L/iJWYUyjeAawMpZw== X-Google-Smtp-Source: APBJJlEzo8Btw5r49bI8cRZV8xcJf8DiQb+Mu6Ml21Ez5UUIFY0GcFyjQx9/Q3mF9/WZkolgKOxy8g== X-Received: by 2002:a1c:ed16:0:b0:3fc:186:284d with SMTP id l22-20020a1ced16000000b003fc0186284dmr992958wmh.18.1690531217480; Fri, 28 Jul 2023 01:00:17 -0700 (PDT) Received: from localhost ([2a01:cb19:85e6:1900:2bf7:7388:731d:c4e1]) by smtp.gmail.com with ESMTPSA id h14-20020a05600c260e00b003fbca942499sm6485517wma.14.2023.07.28.01.00.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 28 Jul 2023 01:00:17 -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 3/8] bootstd: Rename bootdev_setup_sibling_blk() In-Reply-To: <20230728023755.680278-4-sjg@chromium.org> References: <20230728023755.680278-1-sjg@chromium.org> <20230728023755.680278-4-sjg@chromium.org> Date: Fri, 28 Jul 2023 10:00:16 +0200 Message-ID: <875y644ga7.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 jeu., juil. 27, 2023 at 20:37, 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 > --- > > 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 | 8 ++++---- > 8 files changed, 16 insertions(+), 14 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..0abc56cab9c8 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 > @@ -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); Can we also fix the documentation string? Right now, on master (c98c401dfb48), the documentation strings states: * bootdev_setup_for_blk() - Bind a new bootdev device for a blk device This should be renamed to: * bootdev_setup_for_sibling_blk() - Bind a new bootdev device for a blk device > > /** > * 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