4747 * GPIOs can sometimes cost only an instruction or two per bit.
4848 */
4949
50-
51- /* When debugging, extend minimal trust to callers and platform code.
52- * Also emit diagnostic messages that may help initial bringup, when
53- * board setup or driver bugs are most common.
54- *
55- * Otherwise, minimize overhead in what may be bitbanging codepaths.
56- */
57- #ifdef DEBUG
58- #define extra_checks 1
59- #else
60- #define extra_checks 0
61- #endif
62-
6350/* Device and char device-related information */
6451static DEFINE_IDA (gpio_ida );
6552static dev_t gpio_devt ;
@@ -2351,7 +2338,7 @@ void gpiod_free(struct gpio_desc *desc)
23512338 return ;
23522339
23532340 if (!gpiod_free_commit (desc ))
2354- WARN_ON (extra_checks );
2341+ WARN_ON (1 );
23552342
23562343 module_put (desc -> gdev -> owner );
23572344 gpio_device_put (desc -> gdev );
@@ -3729,7 +3716,7 @@ EXPORT_SYMBOL_GPL(gpiochip_line_is_persistent);
37293716 */
37303717int gpiod_get_raw_value_cansleep (const struct gpio_desc * desc )
37313718{
3732- might_sleep_if ( extra_checks );
3719+ might_sleep ( );
37333720 VALIDATE_DESC (desc );
37343721 return gpiod_get_raw_value_commit (desc );
37353722}
@@ -3748,7 +3735,7 @@ int gpiod_get_value_cansleep(const struct gpio_desc *desc)
37483735{
37493736 int value ;
37503737
3751- might_sleep_if ( extra_checks );
3738+ might_sleep ( );
37523739 VALIDATE_DESC (desc );
37533740 value = gpiod_get_raw_value_commit (desc );
37543741 if (value < 0 )
@@ -3779,7 +3766,7 @@ int gpiod_get_raw_array_value_cansleep(unsigned int array_size,
37793766 struct gpio_array * array_info ,
37803767 unsigned long * value_bitmap )
37813768{
3782- might_sleep_if ( extra_checks );
3769+ might_sleep ( );
37833770 if (!desc_array )
37843771 return - EINVAL ;
37853772 return gpiod_get_array_value_complex (true, true, array_size ,
@@ -3805,7 +3792,7 @@ int gpiod_get_array_value_cansleep(unsigned int array_size,
38053792 struct gpio_array * array_info ,
38063793 unsigned long * value_bitmap )
38073794{
3808- might_sleep_if ( extra_checks );
3795+ might_sleep ( );
38093796 if (!desc_array )
38103797 return - EINVAL ;
38113798 return gpiod_get_array_value_complex (false, true, array_size ,
@@ -3826,7 +3813,7 @@ EXPORT_SYMBOL_GPL(gpiod_get_array_value_cansleep);
38263813 */
38273814void gpiod_set_raw_value_cansleep (struct gpio_desc * desc , int value )
38283815{
3829- might_sleep_if ( extra_checks );
3816+ might_sleep ( );
38303817 VALIDATE_DESC_VOID (desc );
38313818 gpiod_set_raw_value_commit (desc , value );
38323819}
@@ -3844,7 +3831,7 @@ EXPORT_SYMBOL_GPL(gpiod_set_raw_value_cansleep);
38443831 */
38453832void gpiod_set_value_cansleep (struct gpio_desc * desc , int value )
38463833{
3847- might_sleep_if ( extra_checks );
3834+ might_sleep ( );
38483835 VALIDATE_DESC_VOID (desc );
38493836 gpiod_set_value_nocheck (desc , value );
38503837}
@@ -3867,7 +3854,7 @@ int gpiod_set_raw_array_value_cansleep(unsigned int array_size,
38673854 struct gpio_array * array_info ,
38683855 unsigned long * value_bitmap )
38693856{
3870- might_sleep_if ( extra_checks );
3857+ might_sleep ( );
38713858 if (!desc_array )
38723859 return - EINVAL ;
38733860 return gpiod_set_array_value_complex (true, true, array_size , desc_array ,
@@ -3909,7 +3896,7 @@ int gpiod_set_array_value_cansleep(unsigned int array_size,
39093896 struct gpio_array * array_info ,
39103897 unsigned long * value_bitmap )
39113898{
3912- might_sleep_if ( extra_checks );
3899+ might_sleep ( );
39133900 if (!desc_array )
39143901 return - EINVAL ;
39153902 return gpiod_set_array_value_complex (false, true, array_size ,
0 commit comments