[PATCH 04/15] modem-manager: let the `NMDeviceModem' handle hw_is_up() and hw_bring_up()



These actions don't require anything from the `NMModem' object, so just move
them back to `NMDeviceModem'.
---
 src/modem-manager/nm-modem.c | 18 ------------------
 src/modem-manager/nm-modem.h |  4 ----
 src/nm-device-modem.c        |  9 +++++++--
 3 files changed, 7 insertions(+), 24 deletions(-)

diff --git a/src/modem-manager/nm-modem.c b/src/modem-manager/nm-modem.c
index 3fa61eb..26c3536 100644
--- a/src/modem-manager/nm-modem.c
+++ b/src/modem-manager/nm-modem.c
@@ -591,24 +591,6 @@ nm_modem_device_state_changed (NMModem *self,
 
 /*****************************************************************************/
 
-gboolean
-nm_modem_hw_is_up (NMModem *self, NMDevice *device)
-{
-	int ifindex = nm_device_get_ip_ifindex (device);
-
-	return ifindex > 0 ? nm_system_iface_is_up (ifindex) : TRUE;
-}
-
-gboolean
-nm_modem_hw_bring_up (NMModem *self, NMDevice *device, gboolean *no_firmware)
-{
-	int ifindex = nm_device_get_ip_ifindex (device);
-
-	return ifindex > 0 ? nm_system_iface_set_up (ifindex, TRUE, no_firmware) : TRUE;
-}
-
-/*****************************************************************************/
-
 const char *
 nm_modem_get_iface (NMModem *self)
 {
diff --git a/src/modem-manager/nm-modem.h b/src/modem-manager/nm-modem.h
index 56f43c2..d86b1d0 100644
--- a/src/modem-manager/nm-modem.h
+++ b/src/modem-manager/nm-modem.h
@@ -156,10 +156,6 @@ void nm_modem_device_state_changed (NMModem *modem,
                                     NMDeviceState old_state,
                                     NMDeviceStateReason reason);
 
-gboolean nm_modem_hw_is_up (NMModem *modem, NMDevice *device);
-
-gboolean nm_modem_hw_bring_up (NMModem *modem, NMDevice *device, gboolean *no_firmware);
-
 gboolean      nm_modem_get_mm_enabled (NMModem *self);
 
 void          nm_modem_set_mm_enabled (NMModem *self, gboolean enabled);
diff --git a/src/nm-device-modem.c b/src/nm-device-modem.c
index c27934f..3e95863 100644
--- a/src/nm-device-modem.c
+++ b/src/nm-device-modem.c
@@ -29,6 +29,7 @@
 #include "nm-rfkill.h"
 #include "nm-marshal.h"
 #include "nm-logging.h"
+#include "nm-system.h"
 
 G_DEFINE_TYPE (NMDeviceModem, nm_device_modem, NM_TYPE_DEVICE)
 
@@ -245,13 +246,17 @@ complete_connection (NMDevice *device,
 static gboolean
 hw_is_up (NMDevice *device)
 {
-	return nm_modem_hw_is_up (NM_DEVICE_MODEM_GET_PRIVATE (device)->modem, device);
+	int ifindex = nm_device_get_ip_ifindex (device);
+
+	return ifindex > 0 ? nm_system_iface_is_up (ifindex) : TRUE;
 }
 
 static gboolean
 hw_bring_up (NMDevice *device, gboolean *no_firmware)
 {
-	return nm_modem_hw_bring_up (NM_DEVICE_MODEM_GET_PRIVATE (device)->modem, device, no_firmware);
+	int ifindex = nm_device_get_ip_ifindex (device);
+
+	return ifindex > 0 ? nm_system_iface_set_up (ifindex, TRUE, no_firmware) : TRUE;
 }
 
 static void
-- 
1.7.11.7



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]