Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp283201ybg; Fri, 12 Jun 2020 01:08:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyaJR/U9hEZT3XrR9jUdNfSQHoz5BRRMo5/9zwUprFE8ZKop2qWfL39tAg0fKRVYxlsXiYy X-Received: by 2002:a50:cccc:: with SMTP id b12mr10377937edj.68.1591949316520; Fri, 12 Jun 2020 01:08:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591949316; cv=none; d=google.com; s=arc-20160816; b=dtklF27HuJ84BN7np+OQQiw2NbLrM+g2k4+X47ZJPqD3+fzI25mXZOP2q0I0CtRyxO 1XUcVbBJXfK4+z1x3g/32yEN/141eAMxmIVydRrbKd2SafJtYsm0RkyJtkrptiEZL0tZ 4M2/QJtLwM3EWzwmydw9+sog1oBPBptOmR6IAjno/wGunkU6OEt5ScXJNZ1a/QHsgI4g 08CC/6NyC79kQYKAmZSGex7inPyxlfd7QYUv0PK2vD6avNBB85VJvLJ/ul/jVGtSkWhJ BsFywHwDASMsvcjS5k50ClvgmP0P/Afe5XnwbV4qMU2j2rglGBs6XqntsHtW7vAUNhR6 8OxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=XJwZlRPkxuQSsbrn+pfjfytdo7W2dlabFoC7AxR787I=; b=V3S/mZ+riUOyikJkxxlZr5aGpBLbbqIvOAApBE374Pkh0Rz+/BAPHxbwxBvAGCBrLg A9OwHSMWL3RBtj+K+FZfreXClF2FVKSnr/4ZigVmouTOoUdTt4PA6CUiuZB9UHOouOcB yoOya7mTQbek0oEx3bzpmSxWeRdIWi0Qd1ZUUAIjrzXHZW3YjMYiVg2pAmv0XF579S4u vcbmXsEIwAbf0mKga4tl/eiGiDIUwDOfsw6wMdDEhGww8xi+XYyr9r7+II1GuBtPTVF7 3arIOvwELTyWyEEZLjDQG9veKF0WmTpyn5EaYM5YHXSFs02J6/BJA2nE3umHlbr2yXrP LqPA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c10si3499900edj.163.2020.06.12.01.08.12; Fri, 12 Jun 2020 01:08:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726335AbgFLIF4 (ORCPT + 99 others); Fri, 12 Jun 2020 04:05:56 -0400 Received: from m17617.mail.qiye.163.com ([59.111.176.17]:13451 "EHLO m17617.mail.qiye.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726264AbgFLIF4 (ORCPT ); Fri, 12 Jun 2020 04:05:56 -0400 Received: from vivo-HP-ProDesk-680-G4-PCI-MT.vivo.xyz (unknown [58.251.74.226]) by m17617.mail.qiye.163.com (Hmail) with ESMTPA id 57FD526190E; Fri, 12 Jun 2020 16:05:53 +0800 (CST) From: Wang Qing To: Linus Walleij , Bartosz Golaszewski , linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org Cc: opensource.kernel@vivo.com, Wang Qing Subject: [PATCH] drivers\gpio: use kobj_to_dev Date: Fri, 12 Jun 2020 16:05:45 +0800 Message-Id: <1591949145-17098-1-git-send-email-wangqing@vivo.com> X-Mailer: git-send-email 2.7.4 X-HM-Spam-Status: e1kfGhgUHx5ZQUpXWQgYFAkeWUFZS1VLWVdZKFlBSE83V1ktWUFJV1kPCR oVCBIfWUFZGkxISUMdGU9PHR5NVkpOQkpCT0JKTkhMTU1VEwETFhoSFyQUDg9ZV1kWGg8SFR0UWU FZT0tIVUpKS0hKQ1VKS0tZBg++ X-HM-Sender-Digest: e1kMHhlZQR0aFwgeV1kSHx4VD1lBWUc6MyI6NDo5Azg#PwsKMzVNEk0K FREwFDhVSlVKTkJKQk9CSk5PSU5PVTMWGhIXVQwaFRwKEhUcOw0SDRRVGBQWRVlXWRILWUFZTkNV SU5KVUxPVUlJTVlXWQgBWUFKTU9ONwY+ X-HM-Tid: 0a72a79055869375kuws57fd526190e Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use kobj_to_dev() API instead of container_of(). Signed-off-by: Wang Qing --- drivers/gpio/gpiolib-sysfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 drivers/gpio/gpiolib-sysfs.c diff --git a/drivers/gpio/gpiolib-sysfs.c b/drivers/gpio/gpiolib-sysfs.c index 23e3d33..82371fe --- a/drivers/gpio/gpiolib-sysfs.c +++ b/drivers/gpio/gpiolib-sysfs.c @@ -365,7 +365,7 @@ static DEVICE_ATTR_RW(active_low); static umode_t gpio_is_visible(struct kobject *kobj, struct attribute *attr, int n) { - struct device *dev = container_of(kobj, struct device, kobj); + struct device *dev = kobj_to_dev(kobj); struct gpiod_data *data = dev_get_drvdata(dev); struct gpio_desc *desc = data->desc; umode_t mode = attr->mode; -- 2.7.4