Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d9a9c617 authored by William Breathitt Gray's avatar William Breathitt Gray Committed by Greg Kroah-Hartman
Browse files

isa: Implement the max_num_isa_dev macro



max_num_isa_dev is a macro to determine the maximum possible number of
ISA devices which may be registered in the I/O port address space given
the address extent of the ISA devices.

The highest base address possible for an ISA device is 0x3FF; this
results in 1024 possible base addresses. Dividing the number of possible
base addresses by the address extent taken by each device results in the
maximum number of devices on a system.

Signed-off-by: default avatarWilliam Breathitt Gray <vilhelm.gray@gmail.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 339e6e31
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -57,4 +57,15 @@ static void __exit __isa_driver##_exit(void) \
} \
module_exit(__isa_driver##_exit);

/**
 * max_num_isa_dev() - Maximum possible number registered of an ISA device
 * @__ida_dev_ext: ISA device address extent
 *
 * The highest base address possible for an ISA device is 0x3FF; this results in
 * 1024 possible base addresses. Dividing the number of possible base addresses
 * by the address extent taken by each device results in the maximum number of
 * devices on a system.
 */
#define max_num_isa_dev(__isa_dev_ext) (1024 / __isa_dev_ext)

#endif /* __LINUX_ISA_H */