File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -86,10 +86,10 @@ static struct usb_phy *__device_to_usb_phy(struct device *dev)
8686
8787 list_for_each_entry (usb_phy , & phy_list , head ) {
8888 if (usb_phy -> dev == dev )
89- break ;
89+ return usb_phy ;
9090 }
9191
92- return usb_phy ;
92+ return NULL ;
9393}
9494
9595static void usb_phy_set_default_current (struct usb_phy * usb_phy )
@@ -150,8 +150,14 @@ static int usb_phy_uevent(struct device *dev, struct kobj_uevent_env *env)
150150 struct usb_phy * usb_phy ;
151151 char uchger_state [50 ] = { 0 };
152152 char uchger_type [50 ] = { 0 };
153+ unsigned long flags ;
153154
155+ spin_lock_irqsave (& phy_lock , flags );
154156 usb_phy = __device_to_usb_phy (dev );
157+ spin_unlock_irqrestore (& phy_lock , flags );
158+
159+ if (!usb_phy )
160+ return - ENODEV ;
155161
156162 snprintf (uchger_state , ARRAY_SIZE (uchger_state ),
157163 "USB_CHARGER_STATE=%s" , usb_chger_state [usb_phy -> chg_state ]);
You can’t perform that action at this time.
0 commit comments