Lines Matching defs:fixup

324  * @phy_uid_mask: Applied to phydev->phy_id and fixup->phy_uid before
331 struct phy_fixup *fixup = kzalloc(sizeof(*fixup), GFP_KERNEL);
333 if (!fixup)
336 strlcpy(fixup->bus_id, bus_id, sizeof(fixup->bus_id));
337 fixup->phy_uid = phy_uid;
338 fixup->phy_uid_mask = phy_uid_mask;
339 fixup->run = run;
342 list_add_tail(&fixup->list, &phy_fixup_list);
349 /* Registers a fixup to be run on any PHY with the UID in phy_uid */
357 /* Registers a fixup to be run on the PHY with id string bus_id */
367 * @bus_id: A string matches fixup->bus_id (or PHY_ANY_ID) in phy_fixup_list
368 * @phy_uid: A phy id matches fixup->phy_id (or PHY_ANY_UID) in phy_fixup_list
369 * @phy_uid_mask: Applied to phy_uid and fixup->phy_uid before comparison
374 struct phy_fixup *fixup;
381 fixup = list_entry(pos, struct phy_fixup, list);
383 if ((!strcmp(fixup->bus_id, bus_id)) &&
384 ((fixup->phy_uid & phy_uid_mask) ==
386 list_del(&fixup->list);
387 kfree(fixup);
398 /* Unregisters a fixup of any PHY with the UID in phy_uid */
405 /* Unregisters a fixup of the PHY with id string bus_id */
412 /* Returns 1 if fixup matches phydev in bus_id and phy_uid.
415 static int phy_needs_fixup(struct phy_device *phydev, struct phy_fixup *fixup)
417 if (strcmp(fixup->bus_id, phydev_name(phydev)) != 0)
418 if (strcmp(fixup->bus_id, PHY_ANY_ID) != 0)
421 if ((fixup->phy_uid & fixup->phy_uid_mask) !=
422 (phydev->phy_id & fixup->phy_uid_mask))
423 if (fixup->phy_uid != PHY_ANY_UID)
432 struct phy_fixup *fixup;
435 list_for_each_entry(fixup, &phy_fixup_list, list) {
436 if (phy_needs_fixup(phydev, fixup)) {
437 int err = fixup->run(phydev);