Received: by 10.223.164.202 with SMTP id h10csp3171553wrb; Sat, 25 Nov 2017 03:32:40 -0800 (PST) X-Google-Smtp-Source: AGs4zMbg3QRFZOI/GZid5KqNX18lUZ4q4w+O8PezuYrcTFACG6zPn34kU2PuUFAgdp03wAGQ6CJb X-Received: by 10.98.202.26 with SMTP id n26mr6650316pfg.202.1511609559912; Sat, 25 Nov 2017 03:32:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511609559; cv=none; d=google.com; s=arc-20160816; b=L2JOKuqEINSNr9v5XHydYB5H2S1GLSGzN/Pm3WsY0YFNbRfl7mlvdhbjXrKzbPxLFz ny18Wg4AQ8FkDYJpf70TR3hHhrcgJFGGnwrSHWK87bYxg4E/jXA/nkVACEISnmpQejTj E8bFcSKEt0eCRVVvzI3aKtWnhbZIrNvy++pUkuWACmoKqhaL/VCj1K/C7R3E6iGRHfOn QOlR2RloHN6WFPRnCaJRkNjon54td4g7guvlxAlu/imSVfXnHGUBOov9LZhpPbvDtEBI OimAoSUZlY/1vnbeb8EouvxiM79b84W/8kNjH0tQ2HjA06Csytvd1b25Al8pL2kufjZl 72Ow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:date:from:message-id :arc-authentication-results; bh=RKOSFMXcmQovIfHph+6edTHN4WPtk0LpaHZYlUxm+Yg=; b=LNo2kZXLvM9Feht1kP3U3ie8TfGU1t44JkqxPXrEiEJRdzur6ZZQok+BQeU4At4kJv JhmDhFtfI5YtQ5n4R7lB4rSRRFo/Pdef0tBUbD7CFCdbFXclMqug1Jx8NPY0R8G7N8yA 07N5WF6zqdCcBFToLf9qeh0d78Yu4kq9x3oZwAYvJliMTF2lERjNM5z7eASoPiwsW8ZM vqqT2VlhTfh75Czekcprstd+6NNLWfWAUpxrbd9phtGa2lhW0vf12W1vxNgVGLEhMH4R 5/JgGLwG5BBPg2XDoCC+oEpVYm3MzCYxWqDoRbvduvinl14VWu+94BSeIo+4cYmmqYfy 3BTA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w16si19807388plk.568.2017.11.25.03.32.21; Sat, 25 Nov 2017 03:32:39 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751122AbdKYLbY (ORCPT + 79 others); Sat, 25 Nov 2017 06:31:24 -0500 Received: from mailout2.hostsharing.net ([83.223.90.233]:46739 "EHLO mailout2.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751026AbdKYLbX (ORCPT ); Sat, 25 Nov 2017 06:31:23 -0500 Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by mailout2.hostsharing.net (Postfix) with ESMTPS id 0D206103C15A0; Sat, 25 Nov 2017 12:31:22 +0100 (CET) Received: from localhost (6-38-90-81.adsl.cmo.de [81.90.38.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by h08.hostsharing.net (Postfix) with ESMTPSA id 63738611543B; Sat, 25 Nov 2017 12:31:21 +0100 (CET) X-Mailbox-Line: From 1ec777daa342333ed80ee8c5f79c58489f20a591 Mon Sep 17 00:00:00 2001 Message-Id: <1ec777daa342333ed80ee8c5f79c58489f20a591.1511609232.git.lukas@wunner.de> From: Lukas Wunner Date: Sat, 25 Nov 2017 12:31:19 +0100 Subject: [PATCH] nvmem: core: Deduplicate bus_find_device() by name matching To: Srinivas Kandagatla Cc: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org No need to reinvent the wheel, we have bus_find_device_by_name(). Signed-off-by: Lukas Wunner --- drivers/nvmem/core.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/nvmem/core.c b/drivers/nvmem/core.c index 5a5cefd12153..93084ab61e0f 100644 --- a/drivers/nvmem/core.c +++ b/drivers/nvmem/core.c @@ -600,16 +600,11 @@ static void __nvmem_device_put(struct nvmem_device *nvmem) mutex_unlock(&nvmem_mutex); } -static int nvmem_match(struct device *dev, void *data) -{ - return !strcmp(dev_name(dev), data); -} - static struct nvmem_device *nvmem_find(const char *name) { struct device *d; - d = bus_find_device(&nvmem_bus_type, NULL, (void *)name, nvmem_match); + d = bus_find_device_by_name(&nvmem_bus_type, NULL, name); if (!d) return NULL; -- 2.11.0 From 1585311882856380874@xxx Tue Nov 28 12:13:46 +0000 2017 X-GM-THRID: 1585309523220093951 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread