Re: [PATCH 1/2] staging: vt6656: remove unneeded variable: ret
On 03/23/20 23:45:44, John B. Wyatt IV wrote: > vnt_mac_reg_bits_off(priv, MAC_REG_GPIOCTL1, GPIO3_INTMD); This function, and all the functions called in vnt_radio_power_on() returns a value, why don't you catch it and act accordingly (forward error code for example) instead of silencing it? Thanks, Quentin ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH resend 3] staging: rtl8188eu: Add rtw_led_enable module parameter
On Tue, Mar 24, 2020 at 11:36:00AM +0100, Bastien Nocera wrote: > Make it possible to disable the LED, as it can be pretty annoying > depending on where it's located. > > See also https://github.com/lwfinger/rtl8188eu/pull/304 for the > out-of-tree version. > > Signed-off-by: Bastien Nocera > --- > drivers/staging/rtl8188eu/core/rtw_led.c | 6 ++ > drivers/staging/rtl8188eu/include/drv_types.h | 2 ++ > drivers/staging/rtl8188eu/os_dep/os_intfs.c | 5 + > 3 files changed, 13 insertions(+) > > diff --git a/drivers/staging/rtl8188eu/core/rtw_led.c > b/drivers/staging/rtl8188eu/core/rtw_led.c > index d1406cc99768..75a859accb7e 100644 > --- a/drivers/staging/rtl8188eu/core/rtw_led.c > +++ b/drivers/staging/rtl8188eu/core/rtw_led.c > @@ -467,10 +467,16 @@ void blink_handler(struct LED_871x *pLed) > > void led_control_8188eu(struct adapter *padapter, enum LED_CTL_MODE > LedAction) > { > + struct registry_priv *registry_par; > + > if (padapter->bSurpriseRemoved || padapter->bDriverStopped || > !padapter->hw_init_completed) > return; > > + registry_par = &padapter->registrypriv; > + if (!registry_par->led_enable) > + return; > + > if ((padapter->pwrctrlpriv.rf_pwrstate != rf_on && >padapter->pwrctrlpriv.rfoff_reason > RF_CHANGE_BY_PS) && > (LedAction == LED_CTL_TX || LedAction == LED_CTL_RX || > diff --git a/drivers/staging/rtl8188eu/include/drv_types.h > b/drivers/staging/rtl8188eu/include/drv_types.h > index 35c0946bc65d..4ca828141d3f 100644 > --- a/drivers/staging/rtl8188eu/include/drv_types.h > +++ b/drivers/staging/rtl8188eu/include/drv_types.h > @@ -67,6 +67,8 @@ struct registry_priv { > u8 wmm_enable; > u8 uapsd_enable; > > + u8 led_enable; > + > struct wlan_bssid_exdev_network; > > u8 ht_enable; > diff --git a/drivers/staging/rtl8188eu/os_dep/os_intfs.c > b/drivers/staging/rtl8188eu/os_dep/os_intfs.c > index 8907bf6bb7ff..ba55ae741215 100644 > --- a/drivers/staging/rtl8188eu/os_dep/os_intfs.c > +++ b/drivers/staging/rtl8188eu/os_dep/os_intfs.c > @@ -47,6 +47,8 @@ static int rtw_acm_method;/* 0:By SW 1:By HW. */ > static int rtw_wmm_enable = 1;/* default is set to enable the wmm. */ > static int rtw_uapsd_enable; > > +static int rtw_led_enable = 1; > + > static int rtw_ht_enable = 1; > /* 0 :disable, bit(0): enable 2.4g, bit(1): enable 5g */ > static int rtw_cbw40_enable = 3; > @@ -98,6 +100,7 @@ module_param(rtw_channel, int, 0644); > module_param(rtw_wmm_enable, int, 0644); > module_param(rtw_vrtl_carrier_sense, int, 0644); > module_param(rtw_vcs_type, int, 0644); > +module_param(rtw_led_enable, int, 0644); Ick, really? No, no nee module parameters, this is not the 1990's. This should be done on a per-device basis, using the correct apis. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH resend 3] staging: rtl8188eu: Add rtw_led_enable module parameter
On Tue, 2020-03-24 at 12:38 +0100, Greg Kroah-Hartman wrote: > On Tue, Mar 24, 2020 at 11:36:00AM +0100, Bastien Nocera wrote: > > Make it possible to disable the LED, as it can be pretty annoying > > depending on where it's located. > > > > See also https://github.com/lwfinger/rtl8188eu/pull/304 for the > > out-of-tree version. > > > > Signed-off-by: Bastien Nocera > > --- > > drivers/staging/rtl8188eu/core/rtw_led.c | 6 ++ > > drivers/staging/rtl8188eu/include/drv_types.h | 2 ++ > > drivers/staging/rtl8188eu/os_dep/os_intfs.c | 5 + > > 3 files changed, 13 insertions(+) > > > > diff --git a/drivers/staging/rtl8188eu/core/rtw_led.c > > b/drivers/staging/rtl8188eu/core/rtw_led.c > > index d1406cc99768..75a859accb7e 100644 > > --- a/drivers/staging/rtl8188eu/core/rtw_led.c > > +++ b/drivers/staging/rtl8188eu/core/rtw_led.c > > @@ -467,10 +467,16 @@ void blink_handler(struct LED_871x *pLed) > > > > void led_control_8188eu(struct adapter *padapter, enum > > LED_CTL_MODE LedAction) > > { > > + struct registry_priv *registry_par; > > + > > if (padapter->bSurpriseRemoved || padapter->bDriverStopped || > > !padapter->hw_init_completed) > > return; > > > > + registry_par = &padapter->registrypriv; > > + if (!registry_par->led_enable) > > + return; > > + > > if ((padapter->pwrctrlpriv.rf_pwrstate != rf_on && > > padapter->pwrctrlpriv.rfoff_reason > RF_CHANGE_BY_PS) && > > (LedAction == LED_CTL_TX || LedAction == LED_CTL_RX || > > diff --git a/drivers/staging/rtl8188eu/include/drv_types.h > > b/drivers/staging/rtl8188eu/include/drv_types.h > > index 35c0946bc65d..4ca828141d3f 100644 > > --- a/drivers/staging/rtl8188eu/include/drv_types.h > > +++ b/drivers/staging/rtl8188eu/include/drv_types.h > > @@ -67,6 +67,8 @@ struct registry_priv { > > u8 wmm_enable; > > u8 uapsd_enable; > > > > + u8 led_enable; > > + > > struct wlan_bssid_exdev_network; > > > > u8 ht_enable; > > diff --git a/drivers/staging/rtl8188eu/os_dep/os_intfs.c > > b/drivers/staging/rtl8188eu/os_dep/os_intfs.c > > index 8907bf6bb7ff..ba55ae741215 100644 > > --- a/drivers/staging/rtl8188eu/os_dep/os_intfs.c > > +++ b/drivers/staging/rtl8188eu/os_dep/os_intfs.c > > @@ -47,6 +47,8 @@ static int rtw_acm_method;/* 0:By SW 1:By HW. */ > > static int rtw_wmm_enable = 1;/* default is set to enable the > > wmm. */ > > static int rtw_uapsd_enable; > > > > +static int rtw_led_enable = 1; > > + > > static int rtw_ht_enable = 1; > > /* 0 :disable, bit(0): enable 2.4g, bit(1): enable 5g */ > > static int rtw_cbw40_enable = 3; > > @@ -98,6 +100,7 @@ module_param(rtw_channel, int, 0644); > > module_param(rtw_wmm_enable, int, 0644); > > module_param(rtw_vrtl_carrier_sense, int, 0644); > > module_param(rtw_vcs_type, int, 0644); > > +module_param(rtw_led_enable, int, 0644); > > Ick, really? No, no nee module parameters, this is not the 1990's. > > This should be done on a per-device basis, using the correct apis. What API? ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2] staging: vt6656: Use ARRAY_SIZE instead of hardcoded size
On 03/18/20 18:40:15, Oscar Carter wrote: > Use ARRAY_SIZE to replace the hardcoded size so we will never have a > mismatch. > > Signed-off-by: Oscar Carter > --- > Changelog v1 -> v2 > - Use ARRAY_SIZE(priv->cck_pwr_tbl) everywhere instead of introducing a new > variable to hold its value. > > drivers/staging/vt6656/main_usb.c | 7 --- > 1 file changed, 4 insertions(+), 3 deletions(-) > > diff --git a/drivers/staging/vt6656/main_usb.c > b/drivers/staging/vt6656/main_usb.c > index 5e48b3ddb94c..acfcc11c3b61 100644 > --- a/drivers/staging/vt6656/main_usb.c > +++ b/drivers/staging/vt6656/main_usb.c > @@ -23,6 +23,7 @@ > > #include > #include > +#include > #include "device.h" > #include "card.h" > #include "baseband.h" > @@ -145,7 +146,7 @@ static int vnt_init_registers(struct vnt_private *priv) > > init_cmd->init_class = DEVICE_INIT_COLD; > init_cmd->exist_sw_net_addr = priv->exist_sw_net_addr; > - for (ii = 0; ii < 6; ii++) > + for (ii = 0; ii < ARRAY_SIZE(init_cmd->sw_net_addr); ii++) > init_cmd->sw_net_addr[ii] = priv->current_net_addr[ii]; > init_cmd->short_retry_limit = priv->short_retry_limit; > init_cmd->long_retry_limit = priv->long_retry_limit; > @@ -184,7 +185,7 @@ static int vnt_init_registers(struct vnt_private *priv) > priv->cck_pwr = priv->eeprom[EEP_OFS_PWR_CCK]; > priv->ofdm_pwr_g = priv->eeprom[EEP_OFS_PWR_OFDMG]; > /* load power table */ > - for (ii = 0; ii < 14; ii++) { > + for (ii = 0; ii < ARRAY_SIZE(priv->cck_pwr_tbl); ii++) { > priv->cck_pwr_tbl[ii] = > priv->eeprom[ii + EEP_OFS_CCK_PWR_TBL]; > if (priv->cck_pwr_tbl[ii] == 0) > @@ -200,7 +201,7 @@ static int vnt_init_registers(struct vnt_private *priv) >* original zonetype is USA, but custom zonetype is Europe, >* then need to recover 12, 13, 14 channels with 11 channel >*/ > - for (ii = 11; ii < 14; ii++) { > + for (ii = 11; ii < ARRAY_SIZE(priv->cck_pwr_tbl); ii++) { > priv->cck_pwr_tbl[ii] = priv->cck_pwr_tbl[10]; > priv->ofdm_pwr_tbl[ii] = priv->ofdm_pwr_tbl[10]; > } > -- > 2.20.1 > Looks good, however are we certain priv->cck_pwr_tbl and priv->ofdm_pwr_tbl are always the same size? What about using a macro for cck_pwr_tbl and ofdm_pwr_tbl size in device.h? Or a BUILD_BUG() if array's sizes are different? It could be helpful for future developers to say these arrays must be the same size. Thanks, Quentin ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH resend 3] staging: rtl8188eu: Add rtw_led_enable module parameter
On Tue, Mar 24, 2020 at 12:47:01PM +0100, Bastien Nocera wrote: > On Tue, 2020-03-24 at 12:38 +0100, Greg Kroah-Hartman wrote: > > On Tue, Mar 24, 2020 at 11:36:00AM +0100, Bastien Nocera wrote: > > > Make it possible to disable the LED, as it can be pretty annoying > > > depending on where it's located. > > > > > > See also https://github.com/lwfinger/rtl8188eu/pull/304 for the > > > out-of-tree version. > > > > > > Signed-off-by: Bastien Nocera > > > --- > > > drivers/staging/rtl8188eu/core/rtw_led.c | 6 ++ > > > drivers/staging/rtl8188eu/include/drv_types.h | 2 ++ > > > drivers/staging/rtl8188eu/os_dep/os_intfs.c | 5 + > > > 3 files changed, 13 insertions(+) > > > > > > diff --git a/drivers/staging/rtl8188eu/core/rtw_led.c > > > b/drivers/staging/rtl8188eu/core/rtw_led.c > > > index d1406cc99768..75a859accb7e 100644 > > > --- a/drivers/staging/rtl8188eu/core/rtw_led.c > > > +++ b/drivers/staging/rtl8188eu/core/rtw_led.c > > > @@ -467,10 +467,16 @@ void blink_handler(struct LED_871x *pLed) > > > > > > void led_control_8188eu(struct adapter *padapter, enum > > > LED_CTL_MODE LedAction) > > > { > > > + struct registry_priv *registry_par; > > > + > > > if (padapter->bSurpriseRemoved || padapter->bDriverStopped || > > > !padapter->hw_init_completed) > > > return; > > > > > > + registry_par = &padapter->registrypriv; > > > + if (!registry_par->led_enable) > > > + return; > > > + > > > if ((padapter->pwrctrlpriv.rf_pwrstate != rf_on && > > >padapter->pwrctrlpriv.rfoff_reason > RF_CHANGE_BY_PS) && > > > (LedAction == LED_CTL_TX || LedAction == LED_CTL_RX || > > > diff --git a/drivers/staging/rtl8188eu/include/drv_types.h > > > b/drivers/staging/rtl8188eu/include/drv_types.h > > > index 35c0946bc65d..4ca828141d3f 100644 > > > --- a/drivers/staging/rtl8188eu/include/drv_types.h > > > +++ b/drivers/staging/rtl8188eu/include/drv_types.h > > > @@ -67,6 +67,8 @@ struct registry_priv { > > > u8 wmm_enable; > > > u8 uapsd_enable; > > > > > > + u8 led_enable; > > > + > > > struct wlan_bssid_exdev_network; > > > > > > u8 ht_enable; > > > diff --git a/drivers/staging/rtl8188eu/os_dep/os_intfs.c > > > b/drivers/staging/rtl8188eu/os_dep/os_intfs.c > > > index 8907bf6bb7ff..ba55ae741215 100644 > > > --- a/drivers/staging/rtl8188eu/os_dep/os_intfs.c > > > +++ b/drivers/staging/rtl8188eu/os_dep/os_intfs.c > > > @@ -47,6 +47,8 @@ static int rtw_acm_method;/* 0:By SW 1:By HW. */ > > > static int rtw_wmm_enable = 1;/* default is set to enable the > > > wmm. */ > > > static int rtw_uapsd_enable; > > > > > > +static int rtw_led_enable = 1; > > > + > > > static int rtw_ht_enable = 1; > > > /* 0 :disable, bit(0): enable 2.4g, bit(1): enable 5g */ > > > static int rtw_cbw40_enable = 3; > > > @@ -98,6 +100,7 @@ module_param(rtw_channel, int, 0644); > > > module_param(rtw_wmm_enable, int, 0644); > > > module_param(rtw_vrtl_carrier_sense, int, 0644); > > > module_param(rtw_vcs_type, int, 0644); > > > +module_param(rtw_led_enable, int, 0644); > > > > Ick, really? No, no nee module parameters, this is not the 1990's. > > > > This should be done on a per-device basis, using the correct apis. > > What API? Documentation/leds/index.rst should give you a good start :) thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH resend 3] staging: rtl8188eu: Add rtw_led_enable module parameter
On Tue, 2020-03-24 at 13:32 +0100, Greg Kroah-Hartman wrote: > On Tue, Mar 24, 2020 at 12:47:01PM +0100, Bastien Nocera wrote: > > On Tue, 2020-03-24 at 12:38 +0100, Greg Kroah-Hartman wrote: > > > On Tue, Mar 24, 2020 at 11:36:00AM +0100, Bastien Nocera wrote: > > > > Make it possible to disable the LED, as it can be pretty > > > > annoying > > > > depending on where it's located. > > > > > > > > See also https://github.com/lwfinger/rtl8188eu/pull/304 for the > > > > out-of-tree version. > > > > > > > > Signed-off-by: Bastien Nocera > > > > --- > > > > drivers/staging/rtl8188eu/core/rtw_led.c | 6 ++ > > > > drivers/staging/rtl8188eu/include/drv_types.h | 2 ++ > > > > drivers/staging/rtl8188eu/os_dep/os_intfs.c | 5 + > > > > 3 files changed, 13 insertions(+) > > > > > > > > diff --git a/drivers/staging/rtl8188eu/core/rtw_led.c > > > > b/drivers/staging/rtl8188eu/core/rtw_led.c > > > > index d1406cc99768..75a859accb7e 100644 > > > > --- a/drivers/staging/rtl8188eu/core/rtw_led.c > > > > +++ b/drivers/staging/rtl8188eu/core/rtw_led.c > > > > @@ -467,10 +467,16 @@ void blink_handler(struct LED_871x *pLed) > > > > > > > > void led_control_8188eu(struct adapter *padapter, enum > > > > LED_CTL_MODE LedAction) > > > > { > > > > + struct registry_priv *registry_par; > > > > + > > > > if (padapter->bSurpriseRemoved || padapter- > > > > >bDriverStopped || > > > > !padapter->hw_init_completed) > > > > return; > > > > > > > > + registry_par = &padapter->registrypriv; > > > > + if (!registry_par->led_enable) > > > > + return; > > > > + > > > > if ((padapter->pwrctrlpriv.rf_pwrstate != rf_on && > > > > padapter->pwrctrlpriv.rfoff_reason > > > > > RF_CHANGE_BY_PS) && > > > > (LedAction == LED_CTL_TX || LedAction == LED_CTL_RX > > > > || > > > > diff --git a/drivers/staging/rtl8188eu/include/drv_types.h > > > > b/drivers/staging/rtl8188eu/include/drv_types.h > > > > index 35c0946bc65d..4ca828141d3f 100644 > > > > --- a/drivers/staging/rtl8188eu/include/drv_types.h > > > > +++ b/drivers/staging/rtl8188eu/include/drv_types.h > > > > @@ -67,6 +67,8 @@ struct registry_priv { > > > > u8 wmm_enable; > > > > u8 uapsd_enable; > > > > > > > > + u8 led_enable; > > > > + > > > > struct wlan_bssid_exdev_network; > > > > > > > > u8 ht_enable; > > > > diff --git a/drivers/staging/rtl8188eu/os_dep/os_intfs.c > > > > b/drivers/staging/rtl8188eu/os_dep/os_intfs.c > > > > index 8907bf6bb7ff..ba55ae741215 100644 > > > > --- a/drivers/staging/rtl8188eu/os_dep/os_intfs.c > > > > +++ b/drivers/staging/rtl8188eu/os_dep/os_intfs.c > > > > @@ -47,6 +47,8 @@ static int rtw_acm_method;/* 0:By SW 1:By > > > > HW. */ > > > > static int rtw_wmm_enable = 1;/* default is set to enable the > > > > wmm. */ > > > > static int rtw_uapsd_enable; > > > > > > > > +static int rtw_led_enable = 1; > > > > + > > > > static int rtw_ht_enable = 1; > > > > /* 0 :disable, bit(0): enable 2.4g, bit(1): enable 5g */ > > > > static int rtw_cbw40_enable = 3; > > > > @@ -98,6 +100,7 @@ module_param(rtw_channel, int, 0644); > > > > module_param(rtw_wmm_enable, int, 0644); > > > > module_param(rtw_vrtl_carrier_sense, int, 0644); > > > > module_param(rtw_vcs_type, int, 0644); > > > > +module_param(rtw_led_enable, int, 0644); > > > > > > Ick, really? No, no nee module parameters, this is not the > > > 1990's. > > > > > > This should be done on a per-device basis, using the correct > > > apis. > > > > What API? > > Documentation/leds/index.rst should give you a good start :) Given how much work it'd be, I'll give it a miss and carry on using the out-of-tree driver. Thanks for the hint. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [RESEND PATCH v5 0/3] staging: most: move core module out of staging
On Tue, Mar 10, 2020 at 02:02:39PM +0100, Christian Gromm wrote: > v2: > Reported-by: Greg Kroah-Hartman > - use -M option to create patches > v3: > Reported-by: Greg Kroah-Hartman > - fix date range in comment section of core.c > - move code to free up memory to release funtions > - remove noisy log messages > - use dev_* functions for logging > v4: > Reported-by: Greg Kroah-Hartman > - change owner of struct device that is registered with kernel's > device/driver model > - fix linked list race condition > - fix logging behaviour > - fix possible NULL pointer dereference > v5: > rebased and adapted Sorry for the long delay on this, looks good, thanks for sticking with this. All now queued up. greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH resend 3] staging: rtl8188eu: Add rtw_led_enable module parameter
On Tue, Mar 24, 2020 at 01:38:53PM +0100, Bastien Nocera wrote: > On Tue, 2020-03-24 at 13:32 +0100, Greg Kroah-Hartman wrote: > > On Tue, Mar 24, 2020 at 12:47:01PM +0100, Bastien Nocera wrote: > > > On Tue, 2020-03-24 at 12:38 +0100, Greg Kroah-Hartman wrote: > > > > On Tue, Mar 24, 2020 at 11:36:00AM +0100, Bastien Nocera wrote: > > > > > Make it possible to disable the LED, as it can be pretty > > > > > annoying > > > > > depending on where it's located. > > > > > > > > > > See also https://github.com/lwfinger/rtl8188eu/pull/304 for the > > > > > out-of-tree version. > > > > > > > > > > Signed-off-by: Bastien Nocera > > > > > --- > > > > > drivers/staging/rtl8188eu/core/rtw_led.c | 6 ++ > > > > > drivers/staging/rtl8188eu/include/drv_types.h | 2 ++ > > > > > drivers/staging/rtl8188eu/os_dep/os_intfs.c | 5 + > > > > > 3 files changed, 13 insertions(+) > > > > > > > > > > diff --git a/drivers/staging/rtl8188eu/core/rtw_led.c > > > > > b/drivers/staging/rtl8188eu/core/rtw_led.c > > > > > index d1406cc99768..75a859accb7e 100644 > > > > > --- a/drivers/staging/rtl8188eu/core/rtw_led.c > > > > > +++ b/drivers/staging/rtl8188eu/core/rtw_led.c > > > > > @@ -467,10 +467,16 @@ void blink_handler(struct LED_871x *pLed) > > > > > > > > > > void led_control_8188eu(struct adapter *padapter, enum > > > > > LED_CTL_MODE LedAction) > > > > > { > > > > > + struct registry_priv *registry_par; > > > > > + > > > > > if (padapter->bSurpriseRemoved || padapter- > > > > > >bDriverStopped || > > > > > !padapter->hw_init_completed) > > > > > return; > > > > > > > > > > + registry_par = &padapter->registrypriv; > > > > > + if (!registry_par->led_enable) > > > > > + return; > > > > > + > > > > > if ((padapter->pwrctrlpriv.rf_pwrstate != rf_on && > > > > >padapter->pwrctrlpriv.rfoff_reason > > > > > > RF_CHANGE_BY_PS) && > > > > > (LedAction == LED_CTL_TX || LedAction == LED_CTL_RX > > > > > || > > > > > diff --git a/drivers/staging/rtl8188eu/include/drv_types.h > > > > > b/drivers/staging/rtl8188eu/include/drv_types.h > > > > > index 35c0946bc65d..4ca828141d3f 100644 > > > > > --- a/drivers/staging/rtl8188eu/include/drv_types.h > > > > > +++ b/drivers/staging/rtl8188eu/include/drv_types.h > > > > > @@ -67,6 +67,8 @@ struct registry_priv { > > > > > u8 wmm_enable; > > > > > u8 uapsd_enable; > > > > > > > > > > + u8 led_enable; > > > > > + > > > > > struct wlan_bssid_exdev_network; > > > > > > > > > > u8 ht_enable; > > > > > diff --git a/drivers/staging/rtl8188eu/os_dep/os_intfs.c > > > > > b/drivers/staging/rtl8188eu/os_dep/os_intfs.c > > > > > index 8907bf6bb7ff..ba55ae741215 100644 > > > > > --- a/drivers/staging/rtl8188eu/os_dep/os_intfs.c > > > > > +++ b/drivers/staging/rtl8188eu/os_dep/os_intfs.c > > > > > @@ -47,6 +47,8 @@ static int rtw_acm_method;/* 0:By SW 1:By > > > > > HW. */ > > > > > static int rtw_wmm_enable = 1;/* default is set to enable the > > > > > wmm. */ > > > > > static int rtw_uapsd_enable; > > > > > > > > > > +static int rtw_led_enable = 1; > > > > > + > > > > > static int rtw_ht_enable = 1; > > > > > /* 0 :disable, bit(0): enable 2.4g, bit(1): enable 5g */ > > > > > static int rtw_cbw40_enable = 3; > > > > > @@ -98,6 +100,7 @@ module_param(rtw_channel, int, 0644); > > > > > module_param(rtw_wmm_enable, int, 0644); > > > > > module_param(rtw_vrtl_carrier_sense, int, 0644); > > > > > module_param(rtw_vcs_type, int, 0644); > > > > > +module_param(rtw_led_enable, int, 0644); > > > > > > > > Ick, really? No, no nee module parameters, this is not the > > > > 1990's. > > > > > > > > This should be done on a per-device basis, using the correct > > > > apis. > > > > > > What API? > > > > Documentation/leds/index.rst should give you a good start :) > > Given how much work it'd be, I'll give it a miss and carry on using the > out-of-tree driver. Huh? Why not fix this properly, as that's the only way this driver is ever going to be fixed up correctly and get out of staging at all. thanks, greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH resend 3] staging: rtl8188eu: Add rtw_led_enable module parameter
On Tue, 2020-03-24 at 13:48 +0100, Greg Kroah-Hartman wrote: > > Huh? Why not fix this properly, as that's the only way this driver > is > ever going to be fixed up correctly and get out of staging at all. Because, unfortunately, I have limited free time. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2] staging: vt6656: Use ARRAY_SIZE instead of hardcoded size
On Tue, Mar 24, 2020 at 09:54:56AM +, Quentin Deslandes wrote: > On 03/18/20 18:40:15, Oscar Carter wrote: > > Use ARRAY_SIZE to replace the hardcoded size so we will never have a > > mismatch. > > > > Signed-off-by: Oscar Carter > > --- > > Changelog v1 -> v2 > > - Use ARRAY_SIZE(priv->cck_pwr_tbl) everywhere instead of introducing a new > > variable to hold its value. > > > > drivers/staging/vt6656/main_usb.c | 7 --- > > 1 file changed, 4 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/staging/vt6656/main_usb.c > > b/drivers/staging/vt6656/main_usb.c > > index 5e48b3ddb94c..acfcc11c3b61 100644 > > --- a/drivers/staging/vt6656/main_usb.c > > +++ b/drivers/staging/vt6656/main_usb.c > > @@ -23,6 +23,7 @@ > > > > #include > > #include > > +#include > > #include "device.h" > > #include "card.h" > > #include "baseband.h" > > @@ -145,7 +146,7 @@ static int vnt_init_registers(struct vnt_private *priv) > > > > init_cmd->init_class = DEVICE_INIT_COLD; > > init_cmd->exist_sw_net_addr = priv->exist_sw_net_addr; > > - for (ii = 0; ii < 6; ii++) > > + for (ii = 0; ii < ARRAY_SIZE(init_cmd->sw_net_addr); ii++) > > init_cmd->sw_net_addr[ii] = priv->current_net_addr[ii]; > > init_cmd->short_retry_limit = priv->short_retry_limit; > > init_cmd->long_retry_limit = priv->long_retry_limit; > > @@ -184,7 +185,7 @@ static int vnt_init_registers(struct vnt_private *priv) > > priv->cck_pwr = priv->eeprom[EEP_OFS_PWR_CCK]; > > priv->ofdm_pwr_g = priv->eeprom[EEP_OFS_PWR_OFDMG]; > > /* load power table */ > > - for (ii = 0; ii < 14; ii++) { > > + for (ii = 0; ii < ARRAY_SIZE(priv->cck_pwr_tbl); ii++) { > > priv->cck_pwr_tbl[ii] = > > priv->eeprom[ii + EEP_OFS_CCK_PWR_TBL]; > > if (priv->cck_pwr_tbl[ii] == 0) > > @@ -200,7 +201,7 @@ static int vnt_init_registers(struct vnt_private *priv) > > * original zonetype is USA, but custom zonetype is Europe, > > * then need to recover 12, 13, 14 channels with 11 channel > > */ > > - for (ii = 11; ii < 14; ii++) { > > + for (ii = 11; ii < ARRAY_SIZE(priv->cck_pwr_tbl); ii++) { > > priv->cck_pwr_tbl[ii] = priv->cck_pwr_tbl[10]; > > priv->ofdm_pwr_tbl[ii] = priv->ofdm_pwr_tbl[10]; > > } > > -- > > 2.20.1 > > > > Looks good, however are we certain priv->cck_pwr_tbl and > priv->ofdm_pwr_tbl are always the same size? > > What about using a macro for cck_pwr_tbl and ofdm_pwr_tbl size in > device.h? Or a BUILD_BUG() if array's sizes are different? It could be > helpful for future developers to say these arrays must be the same size. That's a bit over engineering something which is pretty trivial. Normally, we would just make the size a define instead of a magic number 14. u8 cck_pwr_tbl[14]; u8 ofdm_pwr_tbl[14]; u8 ofdm_a_pwr_tbl[42]; If people change the size in the future (unlikely) and it causes a bug then they kind of deserve it because they need to ensure all the new stuff is initialized, right? If they change it and it results in a buffer overflow then static checkers would complain. If they changed it and it resulted in uninitialized data being used then it would be zero so that's okay. So, yeah. Ideally we would figure out a reason for the magic number 14 and create a define, but it's not strictly required. This patch makes the code better and doesn't introduce any problems that weren't already there. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH resend 3] staging: rtl8188eu: Add rtw_led_enable module parameter
Make it possible to disable the LED, as it can be pretty annoying depending on where it's located. See also https://github.com/lwfinger/rtl8188eu/pull/304 for the out-of-tree version. Signed-off-by: Bastien Nocera --- drivers/staging/rtl8188eu/core/rtw_led.c | 6 ++ drivers/staging/rtl8188eu/include/drv_types.h | 2 ++ drivers/staging/rtl8188eu/os_dep/os_intfs.c | 5 + 3 files changed, 13 insertions(+) diff --git a/drivers/staging/rtl8188eu/core/rtw_led.c b/drivers/staging/rtl8188eu/core/rtw_led.c index d1406cc99768..75a859accb7e 100644 --- a/drivers/staging/rtl8188eu/core/rtw_led.c +++ b/drivers/staging/rtl8188eu/core/rtw_led.c @@ -467,10 +467,16 @@ void blink_handler(struct LED_871x *pLed) void led_control_8188eu(struct adapter *padapter, enum LED_CTL_MODE LedAction) { + struct registry_priv *registry_par; + if (padapter->bSurpriseRemoved || padapter->bDriverStopped || !padapter->hw_init_completed) return; + registry_par = &padapter->registrypriv; + if (!registry_par->led_enable) + return; + if ((padapter->pwrctrlpriv.rf_pwrstate != rf_on && padapter->pwrctrlpriv.rfoff_reason > RF_CHANGE_BY_PS) && (LedAction == LED_CTL_TX || LedAction == LED_CTL_RX || diff --git a/drivers/staging/rtl8188eu/include/drv_types.h b/drivers/staging/rtl8188eu/include/drv_types.h index 35c0946bc65d..4ca828141d3f 100644 --- a/drivers/staging/rtl8188eu/include/drv_types.h +++ b/drivers/staging/rtl8188eu/include/drv_types.h @@ -67,6 +67,8 @@ struct registry_priv { u8 wmm_enable; u8 uapsd_enable; + u8 led_enable; + struct wlan_bssid_exdev_network; u8 ht_enable; diff --git a/drivers/staging/rtl8188eu/os_dep/os_intfs.c b/drivers/staging/rtl8188eu/os_dep/os_intfs.c index 8907bf6bb7ff..ba55ae741215 100644 --- a/drivers/staging/rtl8188eu/os_dep/os_intfs.c +++ b/drivers/staging/rtl8188eu/os_dep/os_intfs.c @@ -47,6 +47,8 @@ static int rtw_acm_method;/* 0:By SW 1:By HW. */ static int rtw_wmm_enable = 1;/* default is set to enable the wmm. */ static int rtw_uapsd_enable; +static int rtw_led_enable = 1; + static int rtw_ht_enable = 1; /* 0 :disable, bit(0): enable 2.4g, bit(1): enable 5g */ static int rtw_cbw40_enable = 3; @@ -98,6 +100,7 @@ module_param(rtw_channel, int, 0644); module_param(rtw_wmm_enable, int, 0644); module_param(rtw_vrtl_carrier_sense, int, 0644); module_param(rtw_vcs_type, int, 0644); +module_param(rtw_led_enable, int, 0644); module_param(rtw_ht_enable, int, 0644); module_param(rtw_cbw40_enable, int, 0644); module_param(rtw_ampdu_enable, int, 0644); @@ -162,6 +165,8 @@ static void loadparam(struct adapter *padapter, struct net_device *pnetdev) registry_par->wmm_enable = (u8)rtw_wmm_enable; registry_par->uapsd_enable = (u8)rtw_uapsd_enable; + registry_par->led_enable = (u8)rtw_led_enable; + registry_par->ht_enable = (u8)rtw_ht_enable; registry_par->cbw40_enable = (u8)rtw_cbw40_enable; registry_par->ampdu_enable = (u8)rtw_ampdu_enable; ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [RESEND PATCH v5 0/3] staging: most: move core module out of staging
On Tue, 2020-03-24 at 13:44 +0100, Greg KH wrote: > EXTERNAL EMAIL: Do not click links or open attachments unless you > know the content is safe > > On Tue, Mar 10, 2020 at 02:02:39PM +0100, Christian Gromm wrote: > > v2: > > Reported-by: Greg Kroah-Hartman > > - use -M option to create patches > > v3: > > Reported-by: Greg Kroah-Hartman > > - fix date range in comment section of core.c > > - move code to free up memory to release funtions > > - remove noisy log messages > > - use dev_* functions for logging > > v4: > > Reported-by: Greg Kroah-Hartman > > - change owner of struct device that is registered with > > kernel's > > device/driver model > > - fix linked list race condition > > - fix logging behaviour > > - fix possible NULL pointer dereference > > v5: > > rebased and adapted > > Sorry for the long delay on this, looks good, thanks for sticking > with > this. > > All now queued up. Nice! :) Thank you very much, Chris > > greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH resend 3] staging: rtl8188eu: Add rtw_led_enable module parameter
On Tue, 2020-03-24 at 16:20 +0100, Greg Kroah-Hartman wrote: > On Tue, Mar 24, 2020 at 11:36:00AM +0100, Bastien Nocera wrote: > > Make it possible to disable the LED, as it can be pretty annoying > > depending on where it's located. > > > > See also https://github.com/lwfinger/rtl8188eu/pull/304 for the > > out-of-tree version. > > > > Signed-off-by: Bastien Nocera > > --- > > drivers/staging/rtl8188eu/core/rtw_led.c | 6 ++ > > drivers/staging/rtl8188eu/include/drv_types.h | 2 ++ > > drivers/staging/rtl8188eu/os_dep/os_intfs.c | 5 + > > 3 files changed, 13 insertions(+) > > Why was this resent? Didn't I just reject this? It wasn't resent, it's the same mail you already answered. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH resend 3] staging: rtl8188eu: Add rtw_led_enable module parameter
On Tue, Mar 24, 2020 at 11:36:00AM +0100, Bastien Nocera wrote: > Make it possible to disable the LED, as it can be pretty annoying > depending on where it's located. > > See also https://github.com/lwfinger/rtl8188eu/pull/304 for the > out-of-tree version. > > Signed-off-by: Bastien Nocera > --- > drivers/staging/rtl8188eu/core/rtw_led.c | 6 ++ > drivers/staging/rtl8188eu/include/drv_types.h | 2 ++ > drivers/staging/rtl8188eu/os_dep/os_intfs.c | 5 + > 3 files changed, 13 insertions(+) Why was this resent? Didn't I just reject this? greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH resend 3] staging: rtl8188eu: Add rtw_led_enable module parameter
On Tue, Mar 24, 2020 at 04:21:47PM +0100, Bastien Nocera wrote: > On Tue, 2020-03-24 at 16:20 +0100, Greg Kroah-Hartman wrote: > > On Tue, Mar 24, 2020 at 11:36:00AM +0100, Bastien Nocera wrote: > > > Make it possible to disable the LED, as it can be pretty annoying > > > depending on where it's located. > > > > > > See also https://github.com/lwfinger/rtl8188eu/pull/304 for the > > > out-of-tree version. > > > > > > Signed-off-by: Bastien Nocera > > > --- > > > drivers/staging/rtl8188eu/core/rtw_led.c | 6 ++ > > > drivers/staging/rtl8188eu/include/drv_types.h | 2 ++ > > > drivers/staging/rtl8188eu/os_dep/os_intfs.c | 5 + > > > 3 files changed, 13 insertions(+) > > > > Why was this resent? Didn't I just reject this? > > It wasn't resent, it's the same mail you already answered. Ah, slow mailing lists, sorry :) greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: vt6656: Use DIV_ROUND_UP macro instead of specific code
On Mon, Mar 23, 2020 at 11:42:00AM +0100, Greg Kroah-Hartman wrote: > On Sun, Mar 22, 2020 at 12:23:42PM +0100, Oscar Carter wrote: > > Use DIV_ROUND_UP macro instead of specific code with the same purpose. > > Also, remove the unused variables. > > > > Signed-off-by: Oscar Carter > > --- > > drivers/staging/vt6656/baseband.c | 21 - > > 1 file changed, 4 insertions(+), 17 deletions(-) > > Please rebase this against my staging-next branch of my staging.git tree > and resend it as it does not apply to it at the moment at all. > Ok, I rebase against your staging-next branch and I resend the patch as a new version. > thanks, > > greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 0/2] staging: vt6656: change function from always returning 0 to void
Fold these two patches together so its just one patch. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH resend 3] staging: rtl8188eu: Add rtw_led_enable module parameter
On Tue, Mar 24, 2020 at 04:21:47PM +0100, Bastien Nocera wrote: > On Tue, 2020-03-24 at 16:20 +0100, Greg Kroah-Hartman wrote: > > On Tue, Mar 24, 2020 at 11:36:00AM +0100, Bastien Nocera wrote: > > > Make it possible to disable the LED, as it can be pretty annoying > > > depending on where it's located. > > > > > > See also https://github.com/lwfinger/rtl8188eu/pull/304 for the > > > out-of-tree version. > > > > > > Signed-off-by: Bastien Nocera > > > --- > > > drivers/staging/rtl8188eu/core/rtw_led.c | 6 ++ > > > drivers/staging/rtl8188eu/include/drv_types.h | 2 ++ > > > drivers/staging/rtl8188eu/os_dep/os_intfs.c | 5 + > > > 3 files changed, 13 insertions(+) > > > > Why was this resent? Didn't I just reject this? > > It wasn't resent, it's the same mail you already answered. It says "resend" in the subject. regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[staging:staging-testing] BUILD SUCCESS 4a1a3e9bf5654e98bb48f5b074af17af96ded30d
tree/branch: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git staging-testing branch HEAD: 4a1a3e9bf5654e98bb48f5b074af17af96ded30d staging: most: Documentation: move ABI description files out of staging area elapsed time: 483m configs tested: 162 configs skipped: 0 The following configs have been built successfully. More configs may be tested in the coming days. arm allmodconfig arm allnoconfig arm allyesconfig arm64allmodconfig arm64 allnoconfig arm64allyesconfig arm efm32_defconfig arm at91_dt_defconfig armshmobile_defconfig arm64 defconfig arm exynos_defconfig armmulti_v5_defconfig arm sunxi_defconfig armmulti_v7_defconfig sparcallyesconfig nios2 3c120_defconfig openrisc simple_smp_defconfig shallnoconfig i386 alldefconfig i386 allnoconfig i386 allyesconfig i386defconfig ia64 allmodconfig ia64defconfig ia64 allnoconfig ia64 allyesconfig ia64 alldefconfig nios2 10m50_defconfig c6xevmc6678_defconfig xtensa iss_defconfig c6x allyesconfig xtensa common_defconfig openriscor1ksim_defconfig nds32 defconfig nds32 allnoconfig cskydefconfig alpha defconfig h8300 edosk2674_defconfig h8300h8300h-sim_defconfig h8300 h8s-sim_defconfig m68k allmodconfig m68k m5475evb_defconfig m68k multi_defconfig m68k sun3_defconfig arc defconfig arc allyesconfig powerpc defconfig powerpc ppc64_defconfig powerpc rhel-kconfig microblaze mmu_defconfig microblazenommu_defconfig powerpc allnoconfig mips fuloong2e_defconfig mips malta_kvm_defconfig mips allyesconfig mips 64r6el_defconfig mips allnoconfig mips 32r2_defconfig mips allmodconfig pariscallnoconfig parisc allyesconfig pariscgeneric-32bit_defconfig pariscgeneric-64bit_defconfig x86_64 randconfig-a001-20200324 x86_64 randconfig-a002-20200324 x86_64 randconfig-a003-20200324 i386 randconfig-a001-20200324 i386 randconfig-a002-20200324 i386 randconfig-a003-20200324 alpharandconfig-a001-20200324 m68k randconfig-a001-20200324 mips randconfig-a001-20200324 nds32randconfig-a001-20200324 parisc randconfig-a001-20200324 riscvrandconfig-a001-20200324 c6x randconfig-a001-20200324 h8300randconfig-a001-20200324 microblaze randconfig-a001-20200324 nios2randconfig-a001-20200324 sparc64 randconfig-a001-20200324 s390 randconfig-a001-20200324 csky randconfig-a001-20200324 xtensa randconfig-a001-20200324 openrisc randconfig-a001-20200324 sh randconfig-a001-20200324 i386 randconfig-b003-20200324 i386 randconfig-b001-20200324 i386 randconfig-b002-20200324 x86_64 randconfig-b001-20200324 x86_64 randconfig-c001-20200324 x86_64 randconfig-c002-20200324 x86_64 randconfig-c003-20200324 i386 randconfig-c001-20200324 i386 randconfig-c002-20200324 i386 randconfig-c003-20200324 x86_64 randconfig-d001-20200324 x86_64 randconfig-d002-20200324 x86_64 randconfig-d003-20200324 i386 randconfig-d001-20200324 i386 randconfig-d002-20200324 i386
Pls read my message
My Name is Bahar Zanjani Siblings to 45 years old Babak Morteza Zanjani an Iranian billionaire and business magnate apprehended on 2013 sentenced to death penalty and partner to Jailed Iranian Diplomat Ali Reza Monfared. My siblings Babak Morteza Zanjani was the managing director of the UAE-based Sorinet Group, one of Iran's largest business conglomerates from Tehran, Iran currently on death penalty . Due to current sanctions and unrest in my country Iran , I am looking for a relationship with a business or individual in your country so that I can make some investments there. Please, reply me so we can discuss further as you keep this privy .Thanks for your cooperation Bahar Zanjani ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Pls read my message
My Name is Bahar Zanjani Siblings to 45 years old Babak Morteza Zanjani an Iranian billionaire and business magnate apprehended on 2013 sentenced to death penalty and partner to Jailed Iranian Diplomat Ali Reza Monfared. My siblings Babak Morteza Zanjani was the managing director of the UAE-based Sorinet Group, one of Iran's largest business conglomerates from Tehran, Iran currently on death penalty . Due to current sanctions and unrest in my country Iran , I am looking for a relationship with a business or individual in your country so that I can make some investments there. Please, reply me so we can discuss further as you keep this privy .Thanks for your cooperation Bahar Zanjani ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Pls read my message
My Name is Bahar Zanjani Siblings to 45 years old Babak Morteza Zanjani an Iranian billionaire and business magnate apprehended on 2013 sentenced to death penalty and partner to Jailed Iranian Diplomat Ali Reza Monfared. My siblings Babak Morteza Zanjani was the managing director of the UAE-based Sorinet Group, one of Iran's largest business conglomerates from Tehran, Iran currently on death penalty . Due to current sanctions and unrest in my country Iran , I am looking for a relationship with a business or individual in your country so that I can make some investments there. Please, reply me so we can discuss further as you keep this privy .Thanks for your cooperation Bahar Zanjani ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
I await your reply soonest.
Dear Friend, How are you and your entire family? I hope you and your entire family are doing everything possible to stay safe and protected from the coronavirus pandemic. I am your friend Mr. Ismael from the Arab Republic of Syrian. I am eagerly looking for an investment opportunity in your country, can you be of help? Please, it would be nice if I can do some investment in your care and if you are interested please reply me to my private email address: (gc44.271...@gmail.com) so that I could provide you with more details of the investment funds. Thanks for your kind attention. >From me - Ismael ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
I await your reply soonest.
Dear Friend, How are you and your entire family? I hope you and your entire family are doing everything possible to stay safe and protected from the coronavirus pandemic. I am your friend Mr. Ismael from the Arab Republic of Syrian. I am eagerly looking for an investment opportunity in your country, can you be of help? Please, it would be nice if I can do some investment in your care and if you are interested please reply me to my private email address: (gc44.271...@gmail.com) so that I could provide you with more details of the investment funds. Thanks for your kind attention. >From me - Ismael ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
I await your reply soonest.
Dear Friend, How are you and your entire family? I hope you and your entire family are doing everything possible to stay safe and protected from the coronavirus pandemic. I am your friend Mr. Ismael from the Arab Republic of Syrian. I am eagerly looking for an investment opportunity in your country, can you be of help? Please, it would be nice if I can do some investment in your care and if you are interested please reply me to my private email address: (gc44.271...@gmail.com) so that I could provide you with more details of the investment funds. Thanks for your kind attention. >From me - Ismael ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] speakup: misc: Use dynamic minor numbers for speakup devices
Arnd notes in the link: | To clarify: the only numbers that I think should be changed to dynamic | allocation are for drivers/staging/speakup. While this is a fairly old | subsystem, I would expect that it being staging means we can be a | little more progressive with the changes. This releases misc device minor numbers 25-27 for dynamic usage. Link: https://lore.kernel.org/lkml/20200120221323.gj15...@mit.edu/t/ Suggested-by: Arnd Bergmann Signed-off-by: Zhenzhong Duan Acked-by: Samuel Thibault Cc: William Hubbs Cc: Chris Brannon Cc: Kirk Reiser Cc: Greg Kroah-Hartman --- v2: Add Acked-by from Maintainer, no other change. drivers/staging/speakup/devsynth.c | 10 +++--- drivers/staging/speakup/speakup_soft.c | 14 +++--- 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/drivers/staging/speakup/devsynth.c b/drivers/staging/speakup/devsynth.c index d920256..d305716 100644 --- a/drivers/staging/speakup/devsynth.c +++ b/drivers/staging/speakup/devsynth.c @@ -1,16 +1,12 @@ // SPDX-License-Identifier: GPL-2.0 #include -#include /* for misc_register, and SYNTH_MINOR */ +#include /* for misc_register, and MISC_DYNAMIC_MINOR */ #include #include #include "speakup.h" #include "spk_priv.h" -#ifndef SYNTH_MINOR -#define SYNTH_MINOR 25 -#endif - static int misc_registered; static int dev_opened; @@ -67,7 +63,7 @@ static int speakup_file_release(struct inode *ip, struct file *fp) }; static struct miscdevice synth_device = { - .minor = SYNTH_MINOR, + .minor = MISC_DYNAMIC_MINOR, .name = "synth", .fops = &synth_fops, }; @@ -81,7 +77,7 @@ void speakup_register_devsynth(void) pr_warn("Couldn't initialize miscdevice /dev/synth.\n"); } else { pr_info("initialized device: /dev/synth, node (MAJOR %d, MINOR %d)\n", - MISC_MAJOR, SYNTH_MINOR); + MISC_MAJOR, synth_device.minor); misc_registered = 1; } } diff --git a/drivers/staging/speakup/speakup_soft.c b/drivers/staging/speakup/speakup_soft.c index 9d85a3a..eed246f 100644 --- a/drivers/staging/speakup/speakup_soft.c +++ b/drivers/staging/speakup/speakup_soft.c @@ -10,7 +10,7 @@ */ #include -#include /* for misc_register, and SYNTH_MINOR */ +#include /* for misc_register, and MISC_DYNAMIC_MINOR */ #include /* for poll_wait() */ /* schedule(), signal_pending(), TASK_INTERRUPTIBLE */ @@ -20,8 +20,6 @@ #include "speakup.h" #define DRV_VERSION "2.6" -#define SOFTSYNTH_MINOR 26 /* might as well give it one more than /dev/synth */ -#define SOFTSYNTHU_MINOR 27 /* might as well give it one more than /dev/synth */ #define PROCSPEECH 0x0d #define CLEAR_SYNTH 0x18 @@ -375,7 +373,7 @@ static int softsynth_probe(struct spk_synth *synth) if (misc_registered != 0) return 0; memset(&synth_device, 0, sizeof(synth_device)); - synth_device.minor = SOFTSYNTH_MINOR; + synth_device.minor = MISC_DYNAMIC_MINOR; synth_device.name = "softsynth"; synth_device.fops = &softsynth_fops; if (misc_register(&synth_device)) { @@ -384,7 +382,7 @@ static int softsynth_probe(struct spk_synth *synth) } memset(&synthu_device, 0, sizeof(synthu_device)); - synthu_device.minor = SOFTSYNTHU_MINOR; + synthu_device.minor = MISC_DYNAMIC_MINOR; synthu_device.name = "softsynthu"; synthu_device.fops = &softsynthu_fops; if (misc_register(&synthu_device)) { @@ -393,8 +391,10 @@ static int softsynth_probe(struct spk_synth *synth) } misc_registered = 1; - pr_info("initialized device: /dev/softsynth, node (MAJOR 10, MINOR 26)\n"); - pr_info("initialized device: /dev/softsynthu, node (MAJOR 10, MINOR 27)\n"); + pr_info("initialized device: /dev/softsynth, node (MAJOR 10, MINOR %d)\n", + synth_device.minor); + pr_info("initialized device: /dev/softsynthu, node (MAJOR 10, MINOR %d)\n", + synthu_device.minor); return 0; } -- 1.8.3.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel