Lines Matching defs:fixup
399 * @phy_uid_mask: Applied to phydev->phy_id and fixup->phy_uid before
406 struct phy_fixup *fixup = kzalloc(sizeof(*fixup), GFP_KERNEL);
408 if (!fixup)
411 strscpy(fixup->bus_id, bus_id, sizeof(fixup->bus_id));
412 fixup->phy_uid = phy_uid;
413 fixup->phy_uid_mask = phy_uid_mask;
414 fixup->run = run;
417 list_add_tail(&fixup->list, &phy_fixup_list);
424 /* Registers a fixup to be run on any PHY with the UID in phy_uid */
432 /* Registers a fixup to be run on the PHY with id string bus_id */
442 * @bus_id: A string matches fixup->bus_id (or PHY_ANY_ID) in phy_fixup_list
443 * @phy_uid: A phy id matches fixup->phy_id (or PHY_ANY_UID) in phy_fixup_list
444 * @phy_uid_mask: Applied to phy_uid and fixup->phy_uid before comparison
449 struct phy_fixup *fixup;
456 fixup = list_entry(pos, struct phy_fixup, list);
458 if ((!strcmp(fixup->bus_id, bus_id)) &&
459 phy_id_compare(fixup->phy_uid, phy_uid, phy_uid_mask)) {
460 list_del(&fixup->list);
461 kfree(fixup);
472 /* Unregisters a fixup of any PHY with the UID in phy_uid */
479 /* Unregisters a fixup of the PHY with id string bus_id */
486 /* Returns 1 if fixup matches phydev in bus_id and phy_uid.
489 static int phy_needs_fixup(struct phy_device *phydev, struct phy_fixup *fixup)
491 if (strcmp(fixup->bus_id, phydev_name(phydev)) != 0)
492 if (strcmp(fixup->bus_id, PHY_ANY_ID) != 0)
495 if (!phy_id_compare(phydev->phy_id, fixup->phy_uid,
496 fixup->phy_uid_mask))
497 if (fixup->phy_uid != PHY_ANY_UID)
506 struct phy_fixup *fixup;
509 list_for_each_entry(fixup, &phy_fixup_list, list) {
510 if (phy_needs_fixup(phydev, fixup)) {
511 int err = fixup->run(phydev);