Skip to content

Commit 89ff05e

Browse files
stephen hemmingerdavem330
authored andcommitted
phylib: make local function static
The following functions are not used directly by any drivers: phy_attach_direct phy_device_create phy_prepare_link genphy_config_advert genphy_setup_forced phy_config_interrupt phy_clear_interrypt phy_sanitize_settings phy_enable_interrupts phy_disable_interrupts Signed-off-by: Stephen Hemminger <shemminger@vyatta.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent ff2d8d6 commit 89ff05e

4 files changed

Lines changed: 15 additions & 47 deletions

File tree

‎Documentation/networking/phy.txt‎

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -177,18 +177,6 @@ Doing it all yourself
177177

178178
A convenience function to print out the PHY status neatly.
179179

180-
int phy_clear_interrupt(struct phy_device *phydev);
181-
int phy_config_interrupt(struct phy_device *phydev, u32 interrupts);
182-
183-
Clear the PHY's interrupt, and configure which ones are allowed,
184-
respectively. Currently only supports all on, or all off.
185-
186-
int phy_enable_interrupts(struct phy_device *phydev);
187-
int phy_disable_interrupts(struct phy_device *phydev);
188-
189-
Functions which enable/disable PHY interrupts, clearing them
190-
before and after, respectively.
191-
192180
int phy_start_interrupts(struct phy_device *phydev);
193181
int phy_stop_interrupts(struct phy_device *phydev);
194182

@@ -213,12 +201,6 @@ Doing it all yourself
213201
Fills the phydev structure with up-to-date information about the current
214202
settings in the PHY.
215203

216-
void phy_sanitize_settings(struct phy_device *phydev)
217-
218-
Resolves differences between currently desired settings, and
219-
supported settings for the given PHY device. Does not make
220-
the changes in the hardware, though.
221-
222204
int phy_ethtool_sset(struct phy_device *phydev, struct ethtool_cmd *cmd);
223205
int phy_ethtool_gset(struct phy_device *phydev, struct ethtool_cmd *cmd);
224206

‎drivers/net/phy/phy.c‎

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ EXPORT_SYMBOL(phy_print_status);
6565
*
6666
* Returns 0 on success on < 0 on error.
6767
*/
68-
int phy_clear_interrupt(struct phy_device *phydev)
68+
static int phy_clear_interrupt(struct phy_device *phydev)
6969
{
7070
int err = 0;
7171

@@ -82,7 +82,7 @@ int phy_clear_interrupt(struct phy_device *phydev)
8282
*
8383
* Returns 0 on success on < 0 on error.
8484
*/
85-
int phy_config_interrupt(struct phy_device *phydev, u32 interrupts)
85+
static int phy_config_interrupt(struct phy_device *phydev, u32 interrupts)
8686
{
8787
int err = 0;
8888

@@ -208,7 +208,7 @@ static inline int phy_find_valid(int idx, u32 features)
208208
* duplexes. Drop down by one in this order: 1000/FULL,
209209
* 1000/HALF, 100/FULL, 100/HALF, 10/FULL, 10/HALF.
210210
*/
211-
void phy_sanitize_settings(struct phy_device *phydev)
211+
static void phy_sanitize_settings(struct phy_device *phydev)
212212
{
213213
u32 features = phydev->supported;
214214
int idx;
@@ -223,7 +223,6 @@ void phy_sanitize_settings(struct phy_device *phydev)
223223
phydev->speed = settings[idx].speed;
224224
phydev->duplex = settings[idx].duplex;
225225
}
226-
EXPORT_SYMBOL(phy_sanitize_settings);
227226

228227
/**
229228
* phy_ethtool_sset - generic ethtool sset function, handles all the details
@@ -532,7 +531,7 @@ static irqreturn_t phy_interrupt(int irq, void *phy_dat)
532531
* phy_enable_interrupts - Enable the interrupts from the PHY side
533532
* @phydev: target phy_device struct
534533
*/
535-
int phy_enable_interrupts(struct phy_device *phydev)
534+
static int phy_enable_interrupts(struct phy_device *phydev)
536535
{
537536
int err;
538537

@@ -545,13 +544,12 @@ int phy_enable_interrupts(struct phy_device *phydev)
545544

546545
return err;
547546
}
548-
EXPORT_SYMBOL(phy_enable_interrupts);
549547

550548
/**
551549
* phy_disable_interrupts - Disable the PHY interrupts from the PHY side
552550
* @phydev: target phy_device struct
553551
*/
554-
int phy_disable_interrupts(struct phy_device *phydev)
552+
static int phy_disable_interrupts(struct phy_device *phydev)
555553
{
556554
int err;
557555

@@ -574,7 +572,6 @@ int phy_disable_interrupts(struct phy_device *phydev)
574572

575573
return err;
576574
}
577-
EXPORT_SYMBOL(phy_disable_interrupts);
578575

579576
/**
580577
* phy_start_interrupts - request and enable interrupts for a PHY device

‎drivers/net/phy/phy_device.c‎

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ extern void mdio_bus_exit(void);
5757
static LIST_HEAD(phy_fixup_list);
5858
static DEFINE_MUTEX(phy_fixup_lock);
5959

60+
static int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
61+
u32 flags, phy_interface_t interface);
62+
6063
/*
6164
* Creates a new phy_fixup and adds it to the list
6265
* @bus_id: A string which matches phydev->dev.bus_id (or PHY_ANY_ID)
@@ -146,7 +149,8 @@ int phy_scan_fixups(struct phy_device *phydev)
146149
}
147150
EXPORT_SYMBOL(phy_scan_fixups);
148151

149-
struct phy_device* phy_device_create(struct mii_bus *bus, int addr, int phy_id)
152+
static struct phy_device* phy_device_create(struct mii_bus *bus,
153+
int addr, int phy_id)
150154
{
151155
struct phy_device *dev;
152156

@@ -193,7 +197,6 @@ struct phy_device* phy_device_create(struct mii_bus *bus, int addr, int phy_id)
193197

194198
return dev;
195199
}
196-
EXPORT_SYMBOL(phy_device_create);
197200

198201
/**
199202
* get_phy_id - reads the specified addr for its ID.
@@ -316,7 +319,7 @@ EXPORT_SYMBOL(phy_find_first);
316319
* If you want to monitor your own link state, don't call
317320
* this function.
318321
*/
319-
void phy_prepare_link(struct phy_device *phydev,
322+
static void phy_prepare_link(struct phy_device *phydev,
320323
void (*handler)(struct net_device *))
321324
{
322325
phydev->adjust_link = handler;
@@ -435,8 +438,8 @@ int phy_init_hw(struct phy_device *phydev)
435438
* the attaching device, and given a callback for link status
436439
* change. The phy_device is returned to the attaching driver.
437440
*/
438-
int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
439-
u32 flags, phy_interface_t interface)
441+
static int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
442+
u32 flags, phy_interface_t interface)
440443
{
441444
struct device *d = &phydev->dev;
442445

@@ -473,7 +476,6 @@ int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
473476
* (dev_flags and interface) */
474477
return phy_init_hw(phydev);
475478
}
476-
EXPORT_SYMBOL(phy_attach_direct);
477479

478480
/**
479481
* phy_attach - attach a network device to a particular PHY device
@@ -540,7 +542,7 @@ EXPORT_SYMBOL(phy_detach);
540542
* what is supported. Returns < 0 on error, 0 if the PHY's advertisement
541543
* hasn't changed, and > 0 if it has changed.
542544
*/
543-
int genphy_config_advert(struct phy_device *phydev)
545+
static int genphy_config_advert(struct phy_device *phydev)
544546
{
545547
u32 advertise;
546548
int oldadv, adv;
@@ -605,7 +607,6 @@ int genphy_config_advert(struct phy_device *phydev)
605607

606608
return changed;
607609
}
608-
EXPORT_SYMBOL(genphy_config_advert);
609610

610611
/**
611612
* genphy_setup_forced - configures/forces speed/duplex from @phydev
@@ -615,7 +616,7 @@ EXPORT_SYMBOL(genphy_config_advert);
615616
* to the values in phydev. Assumes that the values are valid.
616617
* Please see phy_sanitize_settings().
617618
*/
618-
int genphy_setup_forced(struct phy_device *phydev)
619+
static int genphy_setup_forced(struct phy_device *phydev)
619620
{
620621
int err;
621622
int ctl = 0;

‎include/linux/phy.h‎

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -472,11 +472,7 @@ static inline int phy_write(struct phy_device *phydev, u32 regnum, u16 val)
472472
int get_phy_id(struct mii_bus *bus, int addr, u32 *phy_id);
473473
struct phy_device* get_phy_device(struct mii_bus *bus, int addr);
474474
int phy_device_register(struct phy_device *phy);
475-
int phy_clear_interrupt(struct phy_device *phydev);
476-
int phy_config_interrupt(struct phy_device *phydev, u32 interrupts);
477475
int phy_init_hw(struct phy_device *phydev);
478-
int phy_attach_direct(struct net_device *dev, struct phy_device *phydev,
479-
u32 flags, phy_interface_t interface);
480476
struct phy_device * phy_attach(struct net_device *dev,
481477
const char *bus_id, u32 flags, phy_interface_t interface);
482478
struct phy_device *phy_find_first(struct mii_bus *bus);
@@ -492,17 +488,12 @@ void phy_start(struct phy_device *phydev);
492488
void phy_stop(struct phy_device *phydev);
493489
int phy_start_aneg(struct phy_device *phydev);
494490

495-
void phy_sanitize_settings(struct phy_device *phydev);
496491
int phy_stop_interrupts(struct phy_device *phydev);
497-
int phy_enable_interrupts(struct phy_device *phydev);
498-
int phy_disable_interrupts(struct phy_device *phydev);
499492

500493
static inline int phy_read_status(struct phy_device *phydev) {
501494
return phydev->drv->read_status(phydev);
502495
}
503496

504-
int genphy_config_advert(struct phy_device *phydev);
505-
int genphy_setup_forced(struct phy_device *phydev);
506497
int genphy_restart_aneg(struct phy_device *phydev);
507498
int genphy_config_aneg(struct phy_device *phydev);
508499
int genphy_update_link(struct phy_device *phydev);
@@ -511,8 +502,6 @@ int genphy_suspend(struct phy_device *phydev);
511502
int genphy_resume(struct phy_device *phydev);
512503
void phy_driver_unregister(struct phy_driver *drv);
513504
int phy_driver_register(struct phy_driver *new_driver);
514-
void phy_prepare_link(struct phy_device *phydev,
515-
void (*adjust_link)(struct net_device *));
516505
void phy_state_machine(struct work_struct *work);
517506
void phy_start_machine(struct phy_device *phydev,
518507
void (*handler)(struct net_device *));
@@ -523,7 +512,6 @@ int phy_mii_ioctl(struct phy_device *phydev,
523512
struct ifreq *ifr, int cmd);
524513
int phy_start_interrupts(struct phy_device *phydev);
525514
void phy_print_status(struct phy_device *phydev);
526-
struct phy_device* phy_device_create(struct mii_bus *bus, int addr, int phy_id);
527515
void phy_device_free(struct phy_device *phydev);
528516

529517
int phy_register_fixup(const char *bus_id, u32 phy_uid, u32 phy_uid_mask,

0 commit comments

Comments
 (0)