Re: [PATCH 3/9] drm/xen-front: Read driver configuration from Xen store

2018-02-22 Thread Oleksandr Andrushchenko

On 02/23/2018 01:20 AM, Boris Ostrovsky wrote:

On 02/21/2018 03:03 AM, Oleksandr Andrushchenko wrote:

+
+static int cfg_connector(struct xen_drm_front_info *front_info,
+   struct xen_drm_front_cfg_connector *connector,
+   const char *path, int index)
+{
+   char *connector_path;
+
+   connector_path = devm_kasprintf(_info->xb_dev->dev,
+   GFP_KERNEL, "%s/%d", path, index);
+   if (!connector_path)
+   return -ENOMEM;
+
+   connector->xenstore_path = connector_path;
+   if (xenbus_scanf(XBT_NIL, connector_path, XENDISPL_FIELD_RESOLUTION,
+   "%d" XENDISPL_RESOLUTION_SEPARATOR "%d",
+   >width, >height) < 0) {
+   /* either no entry configured or wrong resolution set */
+   connector->width = 0;
+   connector->height = 0;

Do you also need to set connector->xenstore_path to NULL? Or maybe just
set it after xenbus_scanf() call.

Will move it down the code, after "if", thank you

-boris







Re: [PATCH 3/9] drm/xen-front: Read driver configuration from Xen store

2018-02-22 Thread Oleksandr Andrushchenko

On 02/23/2018 01:20 AM, Boris Ostrovsky wrote:

On 02/21/2018 03:03 AM, Oleksandr Andrushchenko wrote:

+
+static int cfg_connector(struct xen_drm_front_info *front_info,
+   struct xen_drm_front_cfg_connector *connector,
+   const char *path, int index)
+{
+   char *connector_path;
+
+   connector_path = devm_kasprintf(_info->xb_dev->dev,
+   GFP_KERNEL, "%s/%d", path, index);
+   if (!connector_path)
+   return -ENOMEM;
+
+   connector->xenstore_path = connector_path;
+   if (xenbus_scanf(XBT_NIL, connector_path, XENDISPL_FIELD_RESOLUTION,
+   "%d" XENDISPL_RESOLUTION_SEPARATOR "%d",
+   >width, >height) < 0) {
+   /* either no entry configured or wrong resolution set */
+   connector->width = 0;
+   connector->height = 0;

Do you also need to set connector->xenstore_path to NULL? Or maybe just
set it after xenbus_scanf() call.

Will move it down the code, after "if", thank you

-boris







Re: [PATCH 3/9] drm/xen-front: Read driver configuration from Xen store

2018-02-22 Thread Boris Ostrovsky
On 02/21/2018 03:03 AM, Oleksandr Andrushchenko wrote:
> +
> +static int cfg_connector(struct xen_drm_front_info *front_info,
> + struct xen_drm_front_cfg_connector *connector,
> + const char *path, int index)
> +{
> + char *connector_path;
> +
> + connector_path = devm_kasprintf(_info->xb_dev->dev,
> + GFP_KERNEL, "%s/%d", path, index);
> + if (!connector_path)
> + return -ENOMEM;
> +
> + connector->xenstore_path = connector_path;
> + if (xenbus_scanf(XBT_NIL, connector_path, XENDISPL_FIELD_RESOLUTION,
> + "%d" XENDISPL_RESOLUTION_SEPARATOR "%d",
> + >width, >height) < 0) {
> + /* either no entry configured or wrong resolution set */
> + connector->width = 0;
> + connector->height = 0;

Do you also need to set connector->xenstore_path to NULL? Or maybe just
set it after xenbus_scanf() call.

-boris





Re: [PATCH 3/9] drm/xen-front: Read driver configuration from Xen store

2018-02-22 Thread Boris Ostrovsky
On 02/21/2018 03:03 AM, Oleksandr Andrushchenko wrote:
> +
> +static int cfg_connector(struct xen_drm_front_info *front_info,
> + struct xen_drm_front_cfg_connector *connector,
> + const char *path, int index)
> +{
> + char *connector_path;
> +
> + connector_path = devm_kasprintf(_info->xb_dev->dev,
> + GFP_KERNEL, "%s/%d", path, index);
> + if (!connector_path)
> + return -ENOMEM;
> +
> + connector->xenstore_path = connector_path;
> + if (xenbus_scanf(XBT_NIL, connector_path, XENDISPL_FIELD_RESOLUTION,
> + "%d" XENDISPL_RESOLUTION_SEPARATOR "%d",
> + >width, >height) < 0) {
> + /* either no entry configured or wrong resolution set */
> + connector->width = 0;
> + connector->height = 0;

Do you also need to set connector->xenstore_path to NULL? Or maybe just
set it after xenbus_scanf() call.

-boris