All of lore.kernel.org
 help / color / mirror / Atom feed
From: Denis Kenzior <denkenz@gmail.com>
To: ofono@ofono.org
Subject: Re: [PATCH v4 1/3] huawei: detect possible secondary device
Date: Wed, 19 May 2010 19:34:10 -0500	[thread overview]
Message-ID: <201005191934.10749.denkenz@gmail.com> (raw)
In-Reply-To: <20100520080408.17288.52965.stgit@potku.valot.fi>

[-- Attachment #1: Type: text/plain, Size: 1447 bytes --]

Hi Kalle,

>  struct huawei_data {
> -	GAtChat *chat;
> +	GAtChat *chat, *event;
>  };
> 

Minor nitpick, but we prefer:
GAtChat *chat;
GAtChat *event;

in structures.

> @@ -80,6 +81,11 @@ static void huawei_debug(const char *str, void
>  *user_data) ofono_info("%s", str);
>  }
> 
> +static void huawei_event_debug(const char *str, void *user_data)
> +{
> +	ofono_info("* %s", str);
> +}
> +

There is no need for a separate function here.  user_data can be used for 
this:

const char *prefix = user_data;
ofono_info("%s: %s", prefix, str);

> +	modem_device = ofono_modem_get_string(modem, "Device");
> +	event_device = ofono_modem_get_string(modem, "SecondaryDevice");
> +
> +	if (modem_device == NULL || event_device == NULL)
> +		return -EINVAL;
> +
> +	data->chat = create_port(modem_device);
> +
> +	if (data->chat == NULL)
>  		return -EIO;
> 
>  	g_at_chat_add_terminator(data->chat, "COMMAND NOT SUPPORT", -1, FALSE);
> @@ -120,6 +140,20 @@ static int huawei_enable(struct ofono_modem *modem)
>  	if (getenv("OFONO_AT_DEBUG"))
>  		g_at_chat_set_debug(data->chat, huawei_debug, NULL);
> 
> +	data->event = create_port(modem_device);
> +

Event port using the modem device again?

> +	if (data->event) {
> +		g_at_chat_cancel_all(data->event);
> +		g_at_chat_unregister_all(data->event);
> +	}
> +

You might want to unref event here instead of cfun_disable

Regards,
-Denis

  reply	other threads:[~2010-05-20  0:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-20  8:04 [PATCH v4 0/3] Huawei GPRS support Kalle Valo
2010-05-20  8:04 ` [PATCH v4 1/3] huawei: detect possible secondary device Kalle Valo
2010-05-20  0:34   ` Denis Kenzior [this message]
2010-05-20 10:46     ` Kalle Valo
2010-05-20  8:04 ` [PATCH v4 2/3] Move report_signal_strength to atutil Kalle Valo
2010-05-20  0:36   ` Denis Kenzior
2010-05-20 10:23     ` Kalle Valo
2010-05-20  8:04 ` [PATCH v4 3/3] huawei: add gprs context Kalle Valo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=201005191934.10749.denkenz@gmail.com \
    --to=denkenz@gmail.com \
    --cc=ofono@ofono.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.