> +static const struct ksz9477_drive_strength ksz9477_drive_strengths[] = { > + { SW_DRIVE_STRENGTH_2MA, 2000 }, > + { SW_DRIVE_STRENGTH_4MA, 4000 }, > + { SW_DRIVE_STRENGTH_8MA, 8000 }, > + { SW_DRIVE_STRENGTH_12MA, 12000 }, > + { SW_DRIVE_STRENGTH_16MA, 16000 }, > + { SW_DRIVE_STRENGTH_20MA, 20000 }, > + { SW_DRIVE_STRENGTH_24MA, 24000 }, > + { SW_DRIVE_STRENGTH_28MA, 28000 }, These SW_DRIVE_STRENGTH_ values appear in both ksz8795_reg.h and ksz9477_reg.h. Can the code be made common? > +static u32 ksz9477_drive_strength_to_reg(u32 milliamp) > +{ > + size_t array_size = ARRAY_SIZE(ksz9477_drive_strengths); > + int i; > + > + for (i = 0; i < array_size; i++) { > + if (ksz9477_drive_strengths[i].milliamp >= milliamp) > + return ksz9477_drive_strengths[i].reg_val; Normally an exact match is used, not the nearest value. Andrew --- pw-bot: cr