Re: [PATCH 1/2] extcon: fix hang and extcon_get/set_cable_state().
From: Ivan T. Ivanov
Date: Tue Jul 07 2015 - 08:41:00 EST
On Mon, 2015-07-06 at 17:46 +0300, Roger Quadros wrote:
>
> -static int find_cable_index_by_name(struct extcon_dev *edev, const char *name)
> +static int find_cable_id_by_name(struct extcon_dev *edev, const char *name)
> {
> - unsigned int id = EXTCON_NONE;
> + unsigned int id = -EINVAL;
> int i = 0;
>
> - if (edev->max_supported == 0)
> - return -EINVAL;
> -
> - /* Find the the number of extcon cable */
> + /* Find the id of extcon cable */
> while (extcon_name[i]) {
> if (!strncmp(extcon_name[i], name, CABLE_NAME_MAX)) {
> id = i;
> @@ -140,6 +137,19 @@ static int find_cable_index_by_name(struct extcon_dev *edev, const char *name)
> }
> }
>
Thank you Roger, but this still hang. 'i' is not incremented.
Ivan
> + return id;
> +};
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/