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 27BCFECAAD8 for ; Wed, 14 Sep 2022 07:45:58 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 89C4684607; Wed, 14 Sep 2022 09:45:56 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; secure) header.d=gmx.net header.i=@gmx.net header.b="SH1YgXFg"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 0D8BD84AE8; Wed, 14 Sep 2022 09:45:54 +0200 (CEST) Received: from mout.gmx.net (mout.gmx.net [212.227.17.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id EF0E4841E3 for ; Wed, 14 Sep 2022 09:45:49 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=gmx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=xypron.glpk@gmx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1663141548; bh=UB7zLd4bXNOsdawbXGsc5hxHHCYKaKnATlCpm1aIBjw=; h=X-UI-Sender-Class:Date:Subject:To:References:Cc:From:In-Reply-To; b=SH1YgXFgc6iAfn2iEbaz1+bHI/vIDQs9LHRe9XvUXre4HED9l9vI+OjYXvvWZ/9Ec ONyT8X7zaEMQqjFI6VlxVg3eS1juDYGFTXy5IXh6PsEQxyQFZX4OUljNoZG0G+ly5L pcVqY5fTtn/FHcacHAFc4+KFn5Hk/GGCDaN0GWXo= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from [192.168.123.94] ([84.118.157.2]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1McpNy-1p7yl42PTe-00ZwP2; Wed, 14 Sep 2022 09:45:48 +0200 Message-ID: <970c0bcb-4ce4-b339-5367-26742c88e65c@gmx.de> Date: Wed, 14 Sep 2022 09:45:47 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 Subject: Re: [PATCH v2 22/24] blk: Drop if_type Content-Language: en-US To: AKASHI Takahiro References: <20220812013503.1724919-1-sjg@chromium.org> <20220812013503.1724919-23-sjg@chromium.org> <91a37375-fc9e-4099-95f5-63d02d3bb7cc@gmx.de> <20220914020858.GA42806@laputa> Cc: Simon Glass , Tom Rini , Ilias Apalodimas , Masahisa Kojima , U-Boot Mailing List From: Heinrich Schuchardt In-Reply-To: <20220914020858.GA42806@laputa> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:TPYAvyDmgI0clkzFW/NNxmwoihO7TuxrOdN+w02Buypo/om5jSt NF/ZwuATOeq4Ud+BpuvQ3cqCTG2qKGQyvx1uDjLUYZ6t+d6Nim4sZ8vKIS5LkTJRIg6j+l2 Gzocdl/NYInJb+Hm/36Zr7lS35vISontlSae3GzpZ4taz1sp8a2K/Cl0MOTkB9/8EoAPiV9 0fV6AY3IHUvx6Tf8Dcvlg== X-UI-Out-Filterresults: notjunk:1;V03:K0:xlg907u6AsU=:S6HJXx2iJfM33OgYH0RG+D RWvg7xw72brK8PcY/HD1sq0eIkbM1hocFMoSVTUXXKo3liuSuftnTBfUesWW8ULSJMjoKdmjg eYElCYQGNJDxcGOr6WvYvSmJo7kyEjvdMEtwAh1doVJZvQi8lev6f4aFTN0ulhF5lpHbKVUk8 h4dCSoZRDozc1dUQNjfifbSroahx6et15DLS4HB0PsOEi0CDdAOPcxTlXXg6MHdMLRZ65EPco HA3/JNHGG3FcNPNvc5qp5pHNnTUwF40ROV2uMS3Yso+kArO+ksjhGI2ugsVpppztPhGjIPfbv WBROG4JhAQ5amvY5+80Wu4dpHIghtM96S0u6qhUWir5N1TJUSSt8SgnEGTrajR8Q95ZEKQKHP SRj8iXmq+crBxhjOILhyCDZOwLxFiTR4HH4QylRDJLcLpCQkrkdBtkeGOfQmTutBM6GQu/oQJ ZI7MLvG2gv635G69C0P44N65tkNTMqp2xMjaH6FANjupxIJnCfIKnW8dOEIsRyJjzoWQuFusM /Bk1JC5VmR4wELdvtiplTZx8XwG4Onp4GWiZHFjPP/ERheK2qxLmZd+XXvo6CCYgIXmwqB5vv 38nKy+XrsPiPqm+dtMbF6pBCY0N1W2o1iicKwEYA3zWyGFCNeWc64IHfaKn10S+Vx56dcK+gc YckO4EZSmQZuU6ntwxAtkb932X3SM6d012PjLYgyqTwyYnrasPWkCX8hqcZijaonqlh3t3eez e+f/57QS0IjTilAFlOUPBf4KBKDAYOA/OJlzFsjlX5p8X9PTNdhRjwSjbuve7d9cB9kIIWRMq XvJwGnD2+ANGjr866jripLmXt3sS89Z1XJtZIWybhQp5g1F0wKCk1dpNISrNC/X2r8VVNNJhR nwhg443P8GT3yesE6+O9MPaak0y/4D4ZUKIInBwZNbAUY2ACp5y/2JR8OaT2qngMBnxsfxZaT cPlfreUEIcsSSAaZuH2qQBPqXjvWy7RGmgnCCwd6WATbFC6Z59Xk4Iq8kIm0ElJopFeas+QwP Q4bgDOfNbqwC3GJ6/pGMB0tv6wHxswbOdgUPz1/wyqsyq12e9GH6G3tqtSiWRee8larS52eLH 1yCilZ83EL2M80wCy0YFXW63QTLQLaQpqaJMsO9/+cB8s39GE/pON7G3ROrZVY3aM5oS4utaD xuMc69/cuZQ+0v8VPd9ogZ8ErL 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.6 at phobos.denx.de X-Virus-Status: Clean On 9/14/22 04:08, AKASHI Takahiro wrote: > On Tue, Sep 13, 2022 at 06:27:37PM +0200, Heinrich Schuchardt wrote: >> On 8/12/22 03:35, Simon Glass wrote: >>> Use the uclass ID instead. >>> >>> Signed-off-by: Simon Glass >>> --- >>> >>> (no changes since v1) >>> >>> cmd/blk_common.c | 2 +- >>> drivers/block/blk-uclass.c | 34 +++++++++++++++---------------- >>> drivers/block/blk_legacy.c | 20 +++++++++---------- >>> include/blk.h | 41 ++++++++++++++++++-----------------= --- >>> include/efi_loader.h | 2 +- >>> 5 files changed, 48 insertions(+), 51 deletions(-) >>> >>> diff --git a/cmd/blk_common.c b/cmd/blk_common.c >>> index 4e442f2918b..369c5ae4bbe 100644 >>> --- a/cmd/blk_common.c >>> +++ b/cmd/blk_common.c >>> @@ -12,7 +12,7 @@ >>> #include >>> #include >>> >>> -int blk_common_cmd(int argc, char *const argv[], enum if_type if_type= , >>> +int blk_common_cmd(int argc, char *const argv[], enum uclass_id if_ty= pe, >>> int *cur_devnump) >>> { >>> const char *if_name =3D blk_get_if_type_name(if_type); >>> diff --git a/drivers/block/blk-uclass.c b/drivers/block/blk-uclass.c >>> index 436af764f91..a9a85aa37f3 100644 >>> --- a/drivers/block/blk-uclass.c >>> +++ b/drivers/block/blk-uclass.c >>> @@ -34,7 +34,7 @@ static struct { >>> { UCLASS_PVBLOCK, "pvblock" }, >>> }; >>> >>> -static enum if_type if_typename_to_iftype(const char *if_typename) >>> +static enum uclass_id if_typename_to_iftype(const char *if_typename) >>> { >>> int i; >>> >>> @@ -46,7 +46,7 @@ static enum if_type if_typename_to_iftype(const char= *if_typename) >>> return UCLASS_INVALID; >>> } >>> >>> -static enum uclass_id if_type_to_uclass_id(enum if_type if_type) >>> +static enum uclass_id if_type_to_uclass_id(enum uclass_id if_type) >>> { >>> /* >>> * This strange adjustment is used because we use UCLASS_MASS_STOR= AGE >>> @@ -71,7 +71,7 @@ static enum uclass_id if_type_to_uclass_id(enum if_t= ype if_type) >>> return if_type; >>> } >>> >>> -const char *blk_get_if_type_name(enum if_type if_type) >>> +const char *blk_get_if_type_name(enum uclass_id if_type) >>> { >>> int i; >>> >>> @@ -83,7 +83,7 @@ const char *blk_get_if_type_name(enum if_type if_typ= e) >>> return "(none)"; >>> } >>> >>> -struct blk_desc *blk_get_devnum_by_type(enum if_type if_type, int dev= num) >>> +struct blk_desc *blk_get_devnum_by_type(enum uclass_id if_type, int d= evnum) >>> { >>> struct blk_desc *desc; >>> struct udevice *dev; >>> @@ -105,7 +105,7 @@ struct blk_desc *blk_get_devnum_by_type(enum if_ty= pe if_type, int devnum) >>> struct blk_desc *blk_get_devnum_by_typename(const char *if_typename= , int devnum) >>> { >>> enum uclass_id uclass_id; >>> - enum if_type type; >>> + enum uclass_id type; >>> struct udevice *dev; >>> struct uclass *uc; >>> int ret; >>> @@ -185,7 +185,7 @@ struct blk_desc *blk_get_by_device(struct udevice = *dev) >>> * with a higher device number, -ENOENT if there is no such device = but there >>> * is one with a higher number, or other -ve on other error. >>> */ >>> -static int get_desc(enum if_type if_type, int devnum, struct blk_desc= **descp) >>> +static int get_desc(enum uclass_id if_type, int devnum, struct blk_de= sc **descp) >>> { >>> bool found_more =3D false; >>> struct udevice *dev; >>> @@ -218,7 +218,7 @@ static int get_desc(enum if_type if_type, int devn= um, struct blk_desc **descp) >>> return found_more ? -ENOENT : -ENODEV; >>> } >>> >>> -int blk_select_hwpart_devnum(enum if_type if_type, int devnum, int hw= part) >>> +int blk_select_hwpart_devnum(enum uclass_id if_type, int devnum, int = hwpart) >>> { >>> struct udevice *dev; >>> int ret; >>> @@ -230,7 +230,7 @@ int blk_select_hwpart_devnum(enum if_type if_type,= int devnum, int hwpart) >>> return blk_select_hwpart(dev, hwpart); >>> } >>> >>> -int blk_list_part(enum if_type if_type) >>> +int blk_list_part(enum uclass_id if_type) >>> { >>> struct blk_desc *desc; >>> int devnum, ok; >>> @@ -255,7 +255,7 @@ int blk_list_part(enum if_type if_type) >>> return 0; >>> } >>> >>> -int blk_print_part_devnum(enum if_type if_type, int devnum) >>> +int blk_print_part_devnum(enum uclass_id if_type, int devnum) >>> { >>> struct blk_desc *desc; >>> int ret; >>> @@ -270,7 +270,7 @@ int blk_print_part_devnum(enum if_type if_type, in= t devnum) >>> return 0; >>> } >>> >>> -void blk_list_devices(enum if_type if_type) >>> +void blk_list_devices(enum uclass_id if_type) >>> { >>> struct blk_desc *desc; >>> int ret; >>> @@ -289,7 +289,7 @@ void blk_list_devices(enum if_type if_type) >>> } >>> } >>> >>> -int blk_print_device_num(enum if_type if_type, int devnum) >>> +int blk_print_device_num(enum uclass_id if_type, int devnum) >>> { >>> struct blk_desc *desc; >>> int ret; >>> @@ -303,7 +303,7 @@ int blk_print_device_num(enum if_type if_type, int= devnum) >>> return 0; >>> } >>> >>> -int blk_show_device(enum if_type if_type, int devnum) >>> +int blk_show_device(enum uclass_id if_type, int devnum) >>> { >>> struct blk_desc *desc; >>> int ret; >>> @@ -324,7 +324,7 @@ int blk_show_device(enum if_type if_type, int devn= um) >>> return 0; >>> } >>> >>> -ulong blk_read_devnum(enum if_type if_type, int devnum, lbaint_t star= t, >>> +ulong blk_read_devnum(enum uclass_id if_type, int devnum, lbaint_t st= art, >>> lbaint_t blkcnt, void *buffer) >>> { >>> struct blk_desc *desc; >>> @@ -341,7 +341,7 @@ ulong blk_read_devnum(enum if_type if_type, int de= vnum, lbaint_t start, >>> return n; >>> } >>> >>> -ulong blk_write_devnum(enum if_type if_type, int devnum, lbaint_t sta= rt, >>> +ulong blk_write_devnum(enum uclass_id if_type, int devnum, lbaint_t s= tart, >>> lbaint_t blkcnt, const void *buffer) >>> { >>> struct blk_desc *desc; >>> @@ -525,7 +525,7 @@ const char *blk_get_devtype(struct udevice *dev) >>> return uclass_get_name(device_get_uclass_id(parent)); >>> }; >>> >>> -int blk_find_max_devnum(enum if_type if_type) >>> +int blk_find_max_devnum(enum uclass_id if_type) >>> { >>> struct udevice *dev; >>> int max_devnum =3D -ENODEV; >>> @@ -545,7 +545,7 @@ int blk_find_max_devnum(enum if_type if_type) >>> return max_devnum; >>> } >>> >>> -int blk_next_free_devnum(enum if_type if_type) >>> +int blk_next_free_devnum(enum uclass_id if_type) >>> { >>> int ret; >>> >>> @@ -631,7 +631,7 @@ int blk_count_devices(enum blk_flag_t flag) >>> return count; >>> } >>> >>> -static int blk_claim_devnum(enum if_type if_type, int devnum) >>> +static int blk_claim_devnum(enum uclass_id if_type, int devnum) >>> { >>> struct udevice *dev; >>> struct uclass *uc; >>> diff --git a/drivers/block/blk_legacy.c b/drivers/block/blk_legacy.c >>> index bd8a17df6a9..8c6f9cb208e 100644 >>> --- a/drivers/block/blk_legacy.c >>> +++ b/drivers/block/blk_legacy.c >>> @@ -39,7 +39,7 @@ static struct blk_driver *blk_driver_lookup_typename= (const char *if_typename) >>> return NULL; >>> } >>> >>> -const char *blk_get_if_type_name(enum if_type if_type) >>> +const char *blk_get_if_type_name(enum uclass_id if_type) >>> { >>> struct blk_driver *drv =3D blk_driver_lookup_type(if_type); >>> >>> @@ -70,7 +70,7 @@ static int get_desc(struct blk_driver *drv, int devn= um, struct blk_desc **descp) >>> return drv->get_dev(devnum, descp); >>> } >>> >>> -int blk_list_part(enum if_type if_type) >>> +int blk_list_part(enum uclass_id if_type) >>> { >>> struct blk_driver *drv; >>> struct blk_desc *desc; >>> @@ -97,7 +97,7 @@ int blk_list_part(enum if_type if_type) >>> return 0; >>> } >>> >>> -int blk_print_part_devnum(enum if_type if_type, int devnum) >>> +int blk_print_part_devnum(enum uclass_id if_type, int devnum) >>> { >>> struct blk_driver *drv =3D blk_driver_lookup_type(if_type); >>> struct blk_desc *desc; >>> @@ -115,7 +115,7 @@ int blk_print_part_devnum(enum if_type if_type, in= t devnum) >>> return 0; >>> } >>> >>> -void blk_list_devices(enum if_type if_type) >>> +void blk_list_devices(enum uclass_id if_type) >>> { >>> struct blk_driver *drv =3D blk_driver_lookup_type(if_type); >>> struct blk_desc *desc; >>> @@ -133,7 +133,7 @@ void blk_list_devices(enum if_type if_type) >>> } >>> } >>> >>> -int blk_print_device_num(enum if_type if_type, int devnum) >>> +int blk_print_device_num(enum uclass_id if_type, int devnum) >>> { >>> struct blk_driver *drv =3D blk_driver_lookup_type(if_type); >>> struct blk_desc *desc; >>> @@ -150,7 +150,7 @@ int blk_print_device_num(enum if_type if_type, int= devnum) >>> return 0; >>> } >>> >>> -int blk_show_device(enum if_type if_type, int devnum) >>> +int blk_show_device(enum uclass_id if_type, int devnum) >>> { >>> struct blk_driver *drv =3D blk_driver_lookup_type(if_type); >>> struct blk_desc *desc; >>> @@ -174,7 +174,7 @@ int blk_show_device(enum if_type if_type, int devn= um) >>> return 0; >>> } >>> >>> -struct blk_desc *blk_get_devnum_by_type(enum if_type if_type, int dev= num) >>> +struct blk_desc *blk_get_devnum_by_type(enum uclass_id if_type, int d= evnum) >>> { >>> struct blk_driver *drv =3D blk_driver_lookup_type(if_type); >>> struct blk_desc *desc; >>> @@ -214,7 +214,7 @@ struct blk_desc *blk_get_devnum_by_typename(const = char *if_typename, int devnum) >>> return desc; >>> } >>> >>> -ulong blk_read_devnum(enum if_type if_type, int devnum, lbaint_t star= t, >>> +ulong blk_read_devnum(enum uclass_id if_type, int devnum, lbaint_t st= art, >>> lbaint_t blkcnt, void *buffer) >>> { >>> struct blk_driver *drv =3D blk_driver_lookup_type(if_type); >>> @@ -234,7 +234,7 @@ ulong blk_read_devnum(enum if_type if_type, int de= vnum, lbaint_t start, >>> return n; >>> } >>> >>> -ulong blk_write_devnum(enum if_type if_type, int devnum, lbaint_t sta= rt, >>> +ulong blk_write_devnum(enum uclass_id if_type, int devnum, lbaint_t s= tart, >>> lbaint_t blkcnt, const void *buffer) >>> { >>> struct blk_driver *drv =3D blk_driver_lookup_type(if_type); >>> @@ -249,7 +249,7 @@ ulong blk_write_devnum(enum if_type if_type, int d= evnum, lbaint_t start, >>> return desc->block_write(desc, start, blkcnt, buffer); >>> } >>> >>> -int blk_select_hwpart_devnum(enum if_type if_type, int devnum, int hw= part) >>> +int blk_select_hwpart_devnum(enum uclass_id if_type, int devnum, int = hwpart) >>> { >>> struct blk_driver *drv =3D blk_driver_lookup_type(if_type); >>> struct blk_desc *desc; >>> diff --git a/include/blk.h b/include/blk.h >>> index 548cd09d6bb..279f9ea4a9d 100644 >>> --- a/include/blk.h >>> +++ b/include/blk.h >>> @@ -27,9 +27,6 @@ static inline bool blk_enabled(void) >>> return CONFIG_IS_ENABLED(BLK) || IS_ENABLED(CONFIG_SPL_LEGACY_BLOC= K); >>> } >>> >>> -/* Interface types: */ >>> -#define if_type uclass_id >>> - >>> #define BLK_VEN_SIZE 40 >>> #define BLK_PRD_SIZE 20 >>> #define BLK_REV_SIZE 8 >>> @@ -57,7 +54,7 @@ struct blk_desc { >>> * TODO: With driver model we should be able to use the parent >>> * device's uclass instead. >>> */ >>> - enum if_type if_type; /* type of the interface */ >>> + enum uclass_id if_type; /* type of the interface */ >>> int devnum; /* device number */ >>> unsigned char part_type; /* partition type */ >>> unsigned char target; /* target SCSI ID */ >>> @@ -282,7 +279,7 @@ unsigned long blk_derase(struct blk_desc *block_de= v, lbaint_t start, >>> * This function does not activate the device. The device will be r= eturned >>> * whether or not it is activated. >>> * >>> - * @if_type: Interface type (enum if_type_t) >>> + * @if_type: Interface type (enum uclass_id_t) >>> * @devnum: Device number (specific to each interface type) >>> * @devp: the device, if found >>> * Return: 0 if found, -ENODEV if no device found, or other -ve err= or value >>> @@ -292,7 +289,7 @@ int blk_find_device(int if_type, int devnum, struc= t udevice **devp); >>> /** >>> * blk_get_device() - Find and probe a block device ready for use >>> * >>> - * @if_type: Interface type (enum if_type_t) >>> + * @if_type: Interface type (enum uclass_id_t) >>> * @devnum: Device number (specific to each interface type) >>> * @devp: the device, if found >>> * Return: 0 if found, -ENODEV if no device found, or other -ve err= or value >>> @@ -330,7 +327,7 @@ int blk_next_device(struct udevice **devp); >>> * @parent: Parent of the new device >>> * @drv_name: Driver name to use for the block device >>> * @name: Name for the device >>> - * @if_type: Interface type (enum if_type_t) >>> + * @if_type: Interface type (enum uclass_id_t) >>> * @devnum: Device number, specific to the interface type, or -1 to >>> * allocate the next available number >>> * @blksz: Block size of the device in bytes (typically 512) >>> @@ -347,7 +344,7 @@ int blk_create_device(struct udevice *parent, cons= t char *drv_name, >>> * @parent: Parent of the new device >>> * @drv_name: Driver name to use for the block device >>> * @name: Name for the device (parent name is prepended) >>> - * @if_type: Interface type (enum if_type_t) >>> + * @if_type: Interface type (enum uclass_id_t) >>> * @devnum: Device number, specific to the interface type, or -1 to >>> * allocate the next available number >>> * @blksz: Block size of the device in bytes (typically 512) >>> @@ -390,7 +387,7 @@ int blk_unbind_all(int if_type); >>> * Return: maximum device number found, or -ENODEV if none, or othe= r -ve on >>> * error >>> */ >>> -int blk_find_max_devnum(enum if_type if_type); >>> +int blk_find_max_devnum(enum uclass_id if_type); >>> >>> /** >>> * blk_next_free_devnum() - get the next device number for an inter= face type >>> @@ -401,7 +398,7 @@ int blk_find_max_devnum(enum if_type if_type); >>> * @if_type: Interface type to scan >>> * Return: next device number safe to use, or -ve on error >>> */ >>> -int blk_next_free_devnum(enum if_type if_type); >>> +int blk_next_free_devnum(enum uclass_id if_type); >>> >>> /** >>> * blk_select_hwpart() - select a hardware partition >>> @@ -496,7 +493,7 @@ static inline ulong blk_derase(struct blk_desc *bl= ock_dev, lbaint_t start, >>> */ >>> struct blk_driver { >>> const char *if_typename; >>> - enum if_type if_type; >>> + enum uclass_id if_type; >>> int max_devs; >>> struct blk_desc *desc; >>> /** >>> @@ -557,7 +554,7 @@ struct blk_driver *blk_driver_lookup_type(int if_t= ype); >>> * @devnum: Device number >>> * Return: point to block device descriptor, or NULL if not found >>> */ >>> -struct blk_desc *blk_get_devnum_by_type(enum if_type if_type, int dev= num); >>> +struct blk_desc *blk_get_devnum_by_type(enum uclass_id if_type, int d= evnum); >>> >>> /** >>> * blk_get_devnum_by_type() - Get a block device by type name, and = number >>> @@ -594,7 +591,7 @@ int blk_dselect_hwpart(struct blk_desc *desc, int = hwpart); >>> * @if_type: Block device type >>> * Return: 0 if OK, -ENODEV if there is none of that type >>> */ >>> -int blk_list_part(enum if_type if_type); >>> +int blk_list_part(enum uclass_id if_type); >>> >>> /** >>> * blk_list_devices() - list the block devices of a given type >>> @@ -604,7 +601,7 @@ int blk_list_part(enum if_type if_type); >>> * >>> * @if_type: Block device type >>> */ >>> -void blk_list_devices(enum if_type if_type); >>> +void blk_list_devices(enum uclass_id if_type); >>> >>> /** >>> * blk_show_device() - show information about a given block device >>> @@ -615,7 +612,7 @@ void blk_list_devices(enum if_type if_type); >>> * @devnum: Device number >>> * Return: 0 if OK, -ENODEV for invalid device number >>> */ >>> -int blk_show_device(enum if_type if_type, int devnum); >>> +int blk_show_device(enum uclass_id if_type, int devnum); >>> >>> /** >>> * blk_print_device_num() - show information about a given block de= vice >>> @@ -628,7 +625,7 @@ int blk_show_device(enum if_type if_type, int devn= um); >>> * Return: 0 if OK, -ENODEV for invalid device number, -ENOENT if t= he block >>> * device is not connected >>> */ >>> -int blk_print_device_num(enum if_type if_type, int devnum); >>> +int blk_print_device_num(enum uclass_id if_type, int devnum); >>> >>> /** >>> * blk_print_part_devnum() - print the partition information for a = device >>> @@ -638,7 +635,7 @@ int blk_print_device_num(enum if_type if_type, int= devnum); >>> * Return: 0 if OK, -ENOENT if the block device is not connected, -= ENOSYS if >>> * the interface type is not supported, other -ve on other error >>> */ >>> -int blk_print_part_devnum(enum if_type if_type, int devnum); >>> +int blk_print_part_devnum(enum uclass_id if_type, int devnum); >>> >>> /** >>> * blk_read_devnum() - read blocks from a device >>> @@ -649,7 +646,7 @@ int blk_print_part_devnum(enum if_type if_type, in= t devnum); >>> * @buffer: Address to write data to >>> * Return: number of blocks read, or -ve error number on error >>> */ >>> -ulong blk_read_devnum(enum if_type if_type, int devnum, lbaint_t star= t, >>> +ulong blk_read_devnum(enum uclass_id if_type, int devnum, lbaint_t st= art, >>> lbaint_t blkcnt, void *buffer); >>> >>> /** >>> @@ -661,7 +658,7 @@ ulong blk_read_devnum(enum if_type if_type, int de= vnum, lbaint_t start, >>> * @buffer: Address to read data from >>> * Return: number of blocks written, or -ve error number on error >>> */ >>> -ulong blk_write_devnum(enum if_type if_type, int devnum, lbaint_t sta= rt, >>> +ulong blk_write_devnum(enum uclass_id if_type, int devnum, lbaint_t s= tart, >>> lbaint_t blkcnt, const void *buffer); >>> >>> /** >>> @@ -675,7 +672,7 @@ ulong blk_write_devnum(enum if_type if_type, int d= evnum, lbaint_t start, >>> * @hwpart: Partition number to select >>> * Return: 0 if OK, -ve on error >>> */ >>> -int blk_select_hwpart_devnum(enum if_type if_type, int devnum, int hw= part); >>> +int blk_select_hwpart_devnum(enum uclass_id if_type, int devnum, int = hwpart); >>> >>> /** >>> * blk_get_if_type_name() - Get the name of an interface type >>> @@ -683,7 +680,7 @@ int blk_select_hwpart_devnum(enum if_type if_type,= int devnum, int hwpart); >>> * @if_type: Interface type to check >>> * Return: name of interface, or NULL if none >>> */ >>> -const char *blk_get_if_type_name(enum if_type if_type); >>> +const char *blk_get_if_type_name(enum uclass_id if_type); >>> >>> /** >>> * blk_common_cmd() - handle common commands with block devices >>> @@ -694,7 +691,7 @@ const char *blk_get_if_type_name(enum if_type if_t= ype); >>> * @cur_devnump: Current device number for this interface type >>> * Return: 0 if OK, CMD_RET_ERROR on error >>> */ >>> -int blk_common_cmd(int argc, char *const argv[], enum if_type if_type= , >>> +int blk_common_cmd(int argc, char *const argv[], enum uclass_id if_ty= pe, >>> int *cur_devnump); >>> >>> enum blk_flag_t { >>> diff --git a/include/efi_loader.h b/include/efi_loader.h >>> index 3a63a1f75fd..ae58efb0036 100644 >>> --- a/include/efi_loader.h >>> +++ b/include/efi_loader.h >>> @@ -156,7 +156,7 @@ extern bool efi_st_keep_devices; >>> >>> /* EFI system partition */ >>> extern struct efi_system_partition { >>> - enum if_type if_type; >>> + enum uclass_id if_type; >>> int devnum; >> >> Please, rename the field if_type to class_id in a later patch. >> >> Uclass ID and device number may refer to a different device after >> commands like usb init. It would be better if we could use the partitio= n >> GUID to identify a partition in the long term. But that is beyond the >> scope of this series. > > Well, as far as UEFI is concerned, we should use a device path > (and/or a handle to it) to uniquely identify a given device. The address pointed to by a handle or struct udevice * maybe reused after deleting the handle or device. This is why I mentioned the partition GUID. A device path for a partition contains the partition GUID, see UEFI spec 2.10, 10.3.5.1 Hard Drive. Regards Heinrich > > Then the whole code in efi_var_file.c can be rewritten > by using SIMPLE_FILE_SYSTEM_PROTOCOL attached to it. > > -Takahiro Akashi > >> Acked-by: Heinrich Schuchardt >> >> >>> u8 part; >> >> >> >>> } efi_system_partition; >>