From nobody Sat Jan 22 19:36:20 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 51972196AFF3; Sat, 22 Jan 2022 19:36:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Jh61d1tySz3R3F; Sat, 22 Jan 2022 19:36:21 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642880182; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0UiBLfIMFe+OIlnVrodqqYzbZ8vgletLu7YRG8A8l48=; b=gZwwlwq3O2sZZl5gSVGLfaRyW8GiO2q+6e8hca0RVAHDYfod/4GmcvYvEQ0AUw/UDfdJkr 5k/rEUfU4neokyiICT8fuGCi+CR2XwJLEtfNYW03gr3jyE/RPrYneYlnSs7Nlv/9uj/0Ky elseIC0kjohedJ8odBeRdqU+69DaEqsJwVGWgVluYzoqjyzgHPkYetWELRz6+X+ecMYXIv g4u+3FYDxNdy2KY5hgN88iz0+1YJ75C7rGHq8ZyLmDTwuL7iftSD5V1Pw+qz50U8ce8iHd 5X/Hn9HeAeVb6UM8ck9qAMm13x56zn29+BYNki3UpWA0gPpDmRpWaH+e0AQuVA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 7021A15033; Sat, 22 Jan 2022 19:36:20 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 20MJaKn9099888; Sat, 22 Jan 2022 19:36:20 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 20MJaKQH099887; Sat, 22 Jan 2022 19:36:20 GMT (envelope-from git) Date: Sat, 22 Jan 2022 19:36:20 GMT Message-Id: <202201221936.20MJaKQH099887@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Vladimir Kondratyev Subject: git: bc3e9499ca5b - stable/13 - LinuxKPI: Implement dev_driver_string() List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: bc3e9499ca5bcff65884c41ce73bfe67db531d8a Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1642880182; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0UiBLfIMFe+OIlnVrodqqYzbZ8vgletLu7YRG8A8l48=; b=aV5JXldmopBpXlaT3N3VqqEmTchgAOSLfnSrExNTNjqDzyatgtLUfo7M9Rl3bQn1pYO9O5 rI5KdEHc02CWmdr4uRRfGTPGWsw9+CbyGImNuP3ao+Uuj3oJW9IwDZp4BQpOaVw5ZkBoLG l6WKtRxXKaerTgpShqXkSsa4FRVWeUwlewRpmxjo7tyg+gffS3cbPXeCD/KSc21Y30ZLUT MySyLGw81erJzP8F/DIYZEvHFrs3WRc9sVQvpDzTxloI5sA6nxBxKse9DiJ/kAce7qbhF0 C/E860Js4kQIbIS+MO96/+UqOXDtHAEB0nG+qDO6eicmcms5R/cvbFOaVHpmCQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1642880182; a=rsa-sha256; cv=none; b=RjHw9UU6rfHgWANX7QHMVipBYl/SISeA39A5Ip+QRat1M3qm5V2RVVOljvFDieG7t88R3b 3+SUXPS4v18QJ02f+Wku0NTnNCi+Wxc+xE47JOY/5QAGTk+A7IMOtfdSZw9RIniISbeJ/v pFeUveebigMxlSiqdW7Mqp9JqceONhYeNNo/IWszHV4uNQT353BwAuNlV2AkowqRpF26I6 D2YVRWcCODUAcQvtSXALzGzX2xKRDArKQ+t1nbfiggsZrrus5H59snpy5yOc4uzlp4YMz1 gbjqqGrU1UkA8vRaW/QDF4qmV2KdkUVA5EKhORcJq8L+jy/FKTPkagzWLBfvMA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=bc3e9499ca5bcff65884c41ce73bfe67db531d8a commit bc3e9499ca5bcff65884c41ce73bfe67db531d8a Author: Vladimir Kondratyev AuthorDate: 2021-11-15 15:09:14 +0000 Commit: Vladimir Kondratyev CommitDate: 2022-01-22 19:34:36 +0000 LinuxKPI: Implement dev_driver_string() Required by drm-kmod 5.7 MFC after: 1 week Reviewed by: bz, hselasky, manu Differential Revision: https://reviews.freebsd.org/D33290 (cherry picked from commit bc923d93dffc9d82a705d4e5b9960daa9acdcca6) --- sys/compat/linuxkpi/common/include/linux/device.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/sys/compat/linuxkpi/common/include/linux/device.h b/sys/compat/linuxkpi/common/include/linux/device.h index abafcd7ba5c4..04217fa8b35f 100644 --- a/sys/compat/linuxkpi/common/include/linux/device.h +++ b/sys/compat/linuxkpi/common/include/linux/device.h @@ -228,6 +228,21 @@ void lkpi_devres_release_free_list(struct device *); void lkpi_devres_unlink(struct device *, void *); void lkpi_devm_kmalloc_release(struct device *, void *); +static inline const char * +dev_driver_string(const struct device *dev) +{ + driver_t *drv; + const char *str = ""; + + if (dev->bsddev != NULL) { + drv = device_get_driver(dev->bsddev); + if (drv != NULL) + str = drv->name; + } + + return (str); +} + static inline void * dev_get_drvdata(const struct device *dev) {