Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

extcon: Fix indentation coding style to improve readability

Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
Signed-off-by: Myungjoo Ham <myungjoo.ham@samsung.com>

+87 -84
+10 -10
drivers/extcon/extcon-adc-jack.c
··· 27 27 28 28 /** 29 29 * struct adc_jack_data - internal data for adc_jack device driver 30 - * @edev - extcon device. 31 - * @cable_names - list of supported cables. 32 - * @num_cables - size of cable_names. 33 - * @adc_conditions - list of adc value conditions. 34 - * @num_conditions - size of adc_conditions. 35 - * @irq - irq number of attach/detach event (0 if not exist). 36 - * @handling_delay - interrupt handler will schedule extcon event 37 - * handling at handling_delay jiffies. 38 - * @handler - extcon event handler called by interrupt handler. 39 - * @chan - iio channel being queried. 30 + * @edev: extcon device. 31 + * @cable_names: list of supported cables. 32 + * @num_cables: size of cable_names. 33 + * @adc_conditions: list of adc value conditions. 34 + * @num_conditions: size of adc_conditions. 35 + * @irq: irq number of attach/detach event (0 if not exist). 36 + * @handling_delay: interrupt handler will schedule extcon event 37 + * handling at handling_delay jiffies. 38 + * @handler: extcon event handler called by interrupt handler. 39 + * @chan: iio channel being queried. 40 40 */ 41 41 struct adc_jack_data { 42 42 struct extcon_dev edev;
+13 -13
drivers/extcon/extcon-class.c
··· 74 74 75 75 /** 76 76 * check_mutually_exclusive - Check if new_state violates mutually_exclusive 77 - * condition. 77 + * condition. 78 78 * @edev: the extcon device 79 79 * @new_state: new cable attach status for @edev 80 80 * ··· 189 189 190 190 /** 191 191 * extcon_update_state() - Update the cable attach states of the extcon device 192 - * only for the masked bits. 192 + * only for the masked bits. 193 193 * @edev: the extcon device 194 194 * @mask: the bit mask to designate updated bits. 195 195 * @state: new cable attach status for @edev ··· 227 227 edev->state |= state & mask; 228 228 229 229 raw_notifier_call_chain(&edev->nh, old_state, edev); 230 - 231 230 /* This could be in interrupt handler */ 232 231 prop_buf = (char *)get_zeroed_page(GFP_ATOMIC); 233 232 if (prop_buf) { ··· 338 339 339 340 /** 340 341 * extcon_set_cable_state_() - Set the status of a specific cable. 341 - * @edev: the extcon device that has the cable. 342 - * @index: cable index that can be retrieved by extcon_find_cable_index(). 342 + * @edev: the extcon device that has the cable. 343 + * @index: cable index that can be retrieved by 344 + * extcon_find_cable_index(). 343 345 * @cable_state: the new cable status. The default semantics is 344 346 * true: attached / false: detached. 345 347 */ ··· 359 359 360 360 /** 361 361 * extcon_set_cable_state() - Set the status of a specific cable. 362 - * @edev: the extcon device that has the cable. 363 - * @cable_name: cable name. 362 + * @edev: the extcon device that has the cable. 363 + * @cable_name: cable name. 364 364 * @cable_state: the new cable status. The default semantics is 365 365 * true: attached / false: detached. 366 366 * ··· 419 419 420 420 /** 421 421 * extcon_register_interest() - Register a notifier for a state change of a 422 - * specific cable, not an entier set of cables of a 423 - * extcon device. 424 - * @obj: an empty extcon_specific_cable_nb object to be returned. 422 + * specific cable, not an entier set of cables of a 423 + * extcon device. 424 + * @obj: an empty extcon_specific_cable_nb object to be returned. 425 425 * @extcon_name: the name of extcon device. 426 426 * if NULL, extcon_register_interest will register 427 427 * every cable with the target cable_name given. 428 428 * @cable_name: the target cable name. 429 - * @nb: the notifier block to get notified. 429 + * @nb: the notifier block to get notified. 430 430 * 431 431 * Provide an empty extcon_specific_cable_nb. extcon_register_interest() sets 432 432 * the struct for you. ··· 487 487 488 488 /** 489 489 * extcon_unregister_interest() - Unregister the notifier registered by 490 - * extcon_register_interest(). 490 + * extcon_register_interest(). 491 491 * @obj: the extcon_specific_cable_nb object returned by 492 492 * extcon_register_interest(). 493 493 */ ··· 502 502 503 503 /** 504 504 * extcon_register_notifier() - Register a notifiee to get notified by 505 - * any attach status changes from the extcon. 505 + * any attach status changes from the extcon. 506 506 * @edev: the extcon device. 507 507 * @nb: a notifier block to be registered. 508 508 *
+35 -32
include/linux/extcon.h
··· 51 51 enum extcon_cable_name { 52 52 EXTCON_USB = 0, 53 53 EXTCON_USB_HOST, 54 - EXTCON_TA, /* Travel Adaptor */ 54 + EXTCON_TA, /* Travel Adaptor */ 55 55 EXTCON_FAST_CHARGER, 56 56 EXTCON_SLOW_CHARGER, 57 - EXTCON_CHARGE_DOWNSTREAM, /* Charging an external device */ 57 + EXTCON_CHARGE_DOWNSTREAM, /* Charging an external device */ 58 58 EXTCON_HDMI, 59 59 EXTCON_MHL, 60 60 EXTCON_DVI, ··· 76 76 77 77 /** 78 78 * struct extcon_dev - An extcon device represents one external connector. 79 - * @name: The name of this extcon device. Parent device name is used 80 - * if NULL. 79 + * @name: The name of this extcon device. Parent device name is 80 + * used if NULL. 81 81 * @supported_cable: Array of supported cable names ending with NULL. 82 82 * If supported_cable is NULL, cable name related APIs 83 83 * are disabled. ··· 89 89 * be attached simulataneously. {0x7, 0} is equivalent to 90 90 * {0x3, 0x6, 0x5, 0}. If it is {0xFFFFFFFF, 0}, there 91 91 * can be no simultaneous connections. 92 - * @print_name: An optional callback to override the method to print the 93 - * name of the extcon device. 92 + * @print_name: An optional callback to override the method to print the 93 + * name of the extcon device. 94 94 * @print_state: An optional callback to override the method to print the 95 - * status of the extcon device. 96 - * @dev: Device of this extcon. Do not provide at register-time. 97 - * @state: Attach/detach state of this extcon. Do not provide at 98 - * register-time 99 - * @nh: Notifier for the state change events from this extcon 100 - * @entry: To support list of extcon devices so that users can search 101 - * for extcon devices based on the extcon name. 95 + * status of the extcon device. 96 + * @dev: Device of this extcon. Do not provide at register-time. 97 + * @state: Attach/detach state of this extcon. Do not provide at 98 + * register-time. 99 + * @nh: Notifier for the state change events from this extcon 100 + * @entry: To support list of extcon devices so that users can search 101 + * for extcon devices based on the extcon name. 102 102 * @lock: 103 103 * @max_supported: Internal value to store the number of cables. 104 104 * @extcon_dev_type: Device_type struct to provide attribute_groups 105 105 * customized for each extcon device. 106 - * @cables: Sysfs subdirectories. Each represents one cable. 106 + * @cables: Sysfs subdirectories. Each represents one cable. 107 107 * 108 108 * In most cases, users only need to provide "User initializing data" of 109 109 * this struct when registering an extcon. In some exceptional cases, ··· 111 111 * are overwritten by register function. 112 112 */ 113 113 struct extcon_dev { 114 - /* --- Optional user initializing data --- */ 115 - const char *name; 114 + /* Optional user initializing data */ 115 + const char *name; 116 116 const char **supported_cable; 117 - const u32 *mutually_exclusive; 117 + const u32 *mutually_exclusive; 118 118 119 - /* --- Optional callbacks to override class functions --- */ 119 + /* Optional callbacks to override class functions */ 120 120 ssize_t (*print_name)(struct extcon_dev *edev, char *buf); 121 121 ssize_t (*print_state)(struct extcon_dev *edev, char *buf); 122 122 123 - /* --- Internal data. Please do not set. --- */ 124 - struct device *dev; 125 - u32 state; 123 + /* Internal data. Please do not set. */ 124 + struct device *dev; 126 125 struct raw_notifier_head nh; 127 126 struct list_head entry; 128 - spinlock_t lock; /* could be called by irq handler */ 129 127 int max_supported; 128 + spinlock_t lock; /* could be called by irq handler */ 129 + u32 state; 130 130 131 131 /* /sys/class/extcon/.../cable.n/... */ 132 132 struct device_type extcon_dev_type; 133 133 struct extcon_cable *cables; 134 + 134 135 /* /sys/class/extcon/.../mutually_exclusive/... */ 135 136 struct attribute_group attr_g_muex; 136 137 struct attribute **attrs_muex; ··· 139 138 }; 140 139 141 140 /** 142 - * struct extcon_cable - An internal data for each cable of extcon device. 143 - * @edev: The extcon device 141 + * struct extcon_cable - An internal data for each cable of extcon device. 142 + * @edev: The extcon device 144 143 * @cable_index: Index of this cable in the edev 145 - * @attr_g: Attribute group for the cable 146 - * @attr_name: "name" sysfs entry 147 - * @attr_state: "state" sysfs entry 148 - * @attrs: Array pointing to attr_name and attr_state for attr_g 144 + * @attr_g: Attribute group for the cable 145 + * @attr_name: "name" sysfs entry 146 + * @attr_state: "state" sysfs entry 147 + * @attrs: Array pointing to attr_name and attr_state for attr_g 149 148 */ 150 149 struct extcon_cable { 151 150 struct extcon_dev *edev; ··· 160 159 161 160 /** 162 161 * struct extcon_specific_cable_nb - An internal data for 163 - * extcon_register_interest(). 164 - * @internal_nb: a notifier block bridging extcon notifier and cable notifier. 165 - * @user_nb: user provided notifier block for events from a specific cable. 162 + * extcon_register_interest(). 163 + * @internal_nb: A notifier block bridging extcon notifier 164 + * and cable notifier. 165 + * @user_nb: user provided notifier block for events from 166 + * a specific cable. 166 167 * @cable_index: the target cable. 167 - * @edev: the target extcon device. 168 + * @edev: the target extcon device. 168 169 * @previous_value: the saved previous event value. 169 170 */ 170 171 struct extcon_specific_cable_nb {
+21 -21
include/linux/extcon/extcon-adc-jack.h
··· 20 20 21 21 /** 22 22 * struct adc_jack_cond - condition to use an extcon state 23 - * @state - the corresponding extcon state (if 0, this struct denotes 24 - * the last adc_jack_cond element among the array) 25 - * @min_adc - min adc value for this condition 26 - * @max_adc - max adc value for this condition 23 + * @state: the corresponding extcon state (if 0, this struct 24 + * denotes the last adc_jack_cond element among the array) 25 + * @min_adc: min adc value for this condition 26 + * @max_adc: max adc value for this condition 27 27 * 28 28 * For example, if { .state = 0x3, .min_adc = 100, .max_adc = 200}, it means 29 29 * that if ADC value is between (inclusive) 100 and 200, than the cable 0 and ··· 33 33 * because when no adc_jack_cond is met, state = 0 is automatically chosen. 34 34 */ 35 35 struct adc_jack_cond { 36 - u32 state; /* extcon state value. 0 if invalid */ 36 + u32 state; /* extcon state value. 0 if invalid */ 37 37 u32 min_adc; 38 38 u32 max_adc; 39 39 }; 40 40 41 41 /** 42 42 * struct adc_jack_pdata - platform data for adc jack device. 43 - * @name - name of the extcon device. If null, "adc-jack" is used. 44 - * @consumer_channel - Unique name to identify the channel on the consumer 45 - * side. This typically describes the channels used within 46 - * the consumer. E.g. 'battery_voltage' 47 - * @cable_names - array of cable names ending with null. 48 - * @adc_contitions - array of struct adc_jack_cond conditions ending 49 - * with .state = 0 entry. This describes how to decode 50 - * adc values into extcon state. 51 - * @irq_flags - irq flags used for the @irq 52 - * @handling_delay_ms - in some devices, we need to read ADC value some 53 - * milli-seconds after the interrupt occurs. You may 54 - * describe such delays with @handling_delay_ms, which 55 - * is rounded-off by jiffies. 43 + * @name: name of the extcon device. If null, "adc-jack" is used. 44 + * @consumer_channel: Unique name to identify the channel on the consumer 45 + * side. This typically describes the channels used within 46 + * the consumer. E.g. 'battery_voltage' 47 + * @cable_names: array of cable names ending with null. 48 + * @adc_contitions: array of struct adc_jack_cond conditions ending 49 + * with .state = 0 entry. This describes how to decode 50 + * adc values into extcon state. 51 + * @irq_flags: irq flags used for the @irq 52 + * @handling_delay_ms: in some devices, we need to read ADC value some 53 + * milli-seconds after the interrupt occurs. You may 54 + * describe such delays with @handling_delay_ms, which 55 + * is rounded-off by jiffies. 56 56 */ 57 57 struct adc_jack_pdata { 58 58 const char *name; 59 59 const char *consumer_channel; 60 - /* 61 - * The last entry should be NULL 62 - */ 60 + 61 + /* The last entry should be NULL */ 63 62 const char **cable_names; 63 + 64 64 /* The last entry's state should be 0 */ 65 65 struct adc_jack_cond *adc_conditions; 66 66
+8 -8
include/linux/extcon/extcon-gpio.h
··· 25 25 26 26 /** 27 27 * struct gpio_extcon_platform_data - A simple GPIO-controlled extcon device. 28 - * @name The name of this GPIO extcon device. 29 - * @gpio Corresponding GPIO. 30 - * @debounce Debounce time for GPIO IRQ in ms. 31 - * @irq_flags IRQ Flags (e.g., IRQF_TRIGGER_LOW). 32 - * @state_on print_state is overriden with state_on if attached. If Null, 33 - * default method of extcon class is used. 34 - * @state_off print_state is overriden with state_on if detached. If Null, 35 - * default method of extcon class is used. 28 + * @name: The name of this GPIO extcon device. 29 + * @gpio: Corresponding GPIO. 30 + * @debounce: Debounce time for GPIO IRQ in ms. 31 + * @irq_flags: IRQ Flags (e.g., IRQF_TRIGGER_LOW). 32 + * @state_on: print_state is overriden with state_on if attached. 33 + * If NULL, default method of extcon class is used. 34 + * @state_off: print_state is overriden with state_on if detached. 35 + * If NUll, default method of extcon class is used. 36 36 * 37 37 * Note that in order for state_on or state_off to be valid, both state_on 38 38 * and state_off should be not NULL. If at least one of them is NULL,